3 ms·
I think the first example is pretty good: > Build targets clean, depends, all, without occupying the terminal This accommodates a workflow where one wouldn't
by jolmg 6y ago
I think the first example is pretty good:
> Build targets clean, depends, all, without occupying the terminal
This accommodates a workflow where one wouldn't prefer to just open up another terminal to do other stuff (maybe you're not in a graphical environment, maybe there's no tmux, etc.). With just the shell features, one could do `make ... && make ... && make ... &`, but that would cause bothersome output that would prevent you from effectively working in the same terminal. One could redirect the output of those commands, but then you lose it, or you have to think of where to collect it. This provides an alternative where you can background and still have convenient access to the output when you need it.
The other use is something like:
$ nq mpv $youtube_url
$ #work... work... work....
$ nq mpv $next_youtube_url
so that the next starts when the first finishes.
- Zhyl 6y agoThe mpv example was my main thought. If you want to add something to a playlist using mpv's playlist feature you have to stop and restart mpv.
- jolmg 6y agoDoesn't help if you like to loop the playlist, though.
- JNRowe 6y agoIt probably isn't as user friendly as you'd want, but you can reload the playlist by firing commands at a socket. See the "JSON IPC" section in the mpv man page, and specifically the load* commands. jo¹ and socat² are probably the simplest way to use it if you're not looking for heavy scripting. The scriptability of mpv is really nice if you're the sort of person who likes building your perfect environment, and also a huge pit of addictive time sinks. </warning> ¹ https://github.com/jpmens/jo https://github.com/jpmens/jo ² http://www.dest-unreach.org/socat/ http://www.dest-unreach.org/socat/
- waynesonfire 6y agoIt also offers a better history UX. For example, if you issued, make .. && make foobar && make .. and you wanted to just run 'make foobar' again you'd search your history for the last foobar invocation, and be required to do some editing. With nq this wouldn't be necessary. It's also not clear to me if nq has '&&' or ';' semantics in the event a command fails. I suspect it's ';'. Clever and fun tool but unlikely I'll adopt it.