[Feature request]: re use mpv instance
Background
- [x] I have checked ytfzf(1) and ytfzf(5) or the wiki before creating this.
Problem
Every time ytfzf is run, a new instance of the player is opened
Feature
Running ytfzf from the command line will open a new window of mpv every time. However, it is possible to configure mpv to use sockets and send a command to load the new url instead of opening a new instance
echo "{ \"command\": [\"loadfile\", \"$1\"] }" | socat - "/tmp/mpv-socket"
Alternative solutions to problem?
Kill the current one and open it again? I use i3 (specifically regolith) and have the mpv player configured to be sticky and small so it always shows in my desktop:

So it would always span a new window and will lost that configuration... as you can see in the image, I tried with a local file and it works. Will try to do a MR for this feature, but not sure if there is any downside to do it like that
If you want to work on a pull request, i'd recommend modifying the mpvq addon to work across all instances of ytfzf.
Or you could just make a new addon that basically does the same thing as mpvq but works on all instances.
I probably wouldn't merge this feature into the main script.
Thanks for the quick reply @Euro20179 ! You beat me to it lol.
Could you at least review the code I have to see if you see any problem? I will look into either modifying mpvq or adding a new one.