I have a semi oddball thing I'm tinkering with. I'm looking for a way to make launching MPV (video player) to video links easier. MPV's default behavior is to either launch mpv https://url.of.video in terminal, or drag/drop the URL to the MPV window. I don't find this kosher being a keyboard centric person. Instead I'd like to initiate a popup box, paste the URL, hit enter, and have MPV launch the video to that URL. That way I could tie this command to a keyboard shortcut, making the full process crazy easy. I have this complete, but with one minor papercut -- the gnome-terminal window hangs around. It's a simple one liner:
URL=$(yad --entry) && gnome-terminal -- bash -c "mpv $URL"
If I launch that command, I get a popup box thanks to YAD. At this point I paste the URL, hit enter, and in 1-2 seconds an MPV window opens to that video. Awesome. Exactly what I wanted.
The paper cut I mentioned is the fact that gnome-terminal stays running. Not a massive issue, but I'd like to figure out if there's a way for this command above to launch gnome-terminal, call upon MPV, append the variable (URL), and then have gnome-terminal close itself without ending the video stream.
Curious if anybody has any ideas. Thanks much!