Fair enough, but I think part of the problem here is Linux. Because of "freedom", there's a thousand and one libraries and everybody rolls their own --> no sharing. I think in a good GUI OS all apps would use the same font rendering (needed by the CLI anyway), same most things needed by the CLI anyway. So the overhead all of sudden is almost non-existent.XenOS wrote: I'm not talking about pixels, but graphics libraries used by the GUI for rendering menus, widgets etc. such as Qt or GTK. Some also used Motif. And stuff like Cairo for font rendering. Compare this to a lightweight plain X terminal with fixed-width font. Also I use tmux for terminal multiplexing, so I can have several CLI applications running in one terminal.
That's what IDE's are for. If the IDE sucks, then the solution is to fix the IDE, not use grep. Grep has no contextual understanding that the IDE (or whatever app) has.XenOS wrote: I have many use cases for grep: searching stuff in some project's source code (as in C, C++);
I can use ctrl-F in both FF and Chrome.XenOS wrote: piping curl / wget output into grep for finding some specific information in a web resource;
grep != regexp. Nothing prevents you from using regexp in your C++ code, or Java, or anything. The syntax in regexp remains the same, from app to app, but in practice, you'd rarely need it, if the data was structured to begin with.XenOS wrote: Using one tool - grep - with a common syntax for all these different jobs is really convenient.
Specific API, like SQL? Or something even more context aware and simpler? You're saying using something less context aware (magical text) and grep is better?XenOS wrote: It would be horrible if I had to use a GUI and some binary format with a specific API for this.
I agree, browsers fail us. The browser (or HTML service, or whatever) should give us easy access to the data. These are some of the things I'm trying to improve upon.XenOS wrote: Simple example: I found someone put a list of songs on Youtube on a web page and I want to listen to them in random order. Sure, I could copy the links in the browser into some playlist on Youtube. Or I can just run curl on that page, pipe the output into grep to filter out the video links, pipe the output into xargs and run VLC player with that, telling it on the the command line arguments that I want infinite looping, random order and no video to keep it from switching the screensaver off. I can even save the command line into a shell script and next time I find such a nice list, just run that script on the URL.
I do think the solution you present is flawed, not just in practice, but also in that it tries to treat the symptoms.
In practice, how do you grep the links? I haven't checked Youtube HTML, but unless it has some super convenient tags, you're going to get all URL's on the page, half of which have nothing to do with your music (like link to ToS).
In principle, I think screensaver is orthogonal to video is playing or not (this is a Linux problem #1), and we should have access to the semantic data, in this case the actual playlist. With access to the playlist, we'd also get access to the links in the playlist --> give that to the _music_ (not video) player, and you're problems are solved.
#1, Linux is not a real OS, it's a kernel and a thousand distros, thus nothing is ever unified and all the benefits of that are lost. There's no central component that would know if the screen should switch off or not.
PS. I'm obviously not claiming to have solved all of the above. Rather I think grep is like C, made decades ago and lacking today. I use Linux, CLI, grep, etc, daily, and all the time I think there should be a better way. With programming IntelliJ does offer a lot of improvements, but still not enough, in part because of bad languages (Java, C/C++, etc). With IntelliJ+Java I'd rather follow the contextual links in the IDE any day over grep, though occasionally I do use grep if it's something that crosses project boundaries. But again, that's a problem with the tool (IDE), and not a praise of grep. The only reason to use grep is because everything else failed you.