diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-11-22 13:49:32 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-11-22 13:49:32 +0100 |
commit | 0a84c3d984349e96ddd8077cf2bdd9e08ccb4300 (patch) | |
tree | f04e127a4c6f98645ee3076f2031f5fc6e1b9f43 /bin/menuscripts/mmpv | |
parent | 7f2e035fcec31435fb93cd9d8258a6034b8caa7a (diff) | |
parent | 1024bf9cb8f38ff9cdd6e58a7614d1de8a5bbb29 (diff) |
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'bin/menuscripts/mmpv')
-rwxr-xr-x | bin/menuscripts/mmpv | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/menuscripts/mmpv b/bin/menuscripts/mmpv new file mode 100755 index 0000000..76c0d6a --- /dev/null +++ b/bin/menuscripts/mmpv @@ -0,0 +1,8 @@ +#!/bin/sh +# Have an mpv instance that works with a socket somewhat globally +socket="/tmp/mpvsocket" +# Start mpv in idle if socket is not getting listened to +nc -zvU "$socket" || setsid mpv --input-ipc-server=/tmp/mpvsocket --idle & +file="$(PLAYER='echo' mmedia video)" +[ "$file" ] || exit 1 +echo '{ "command": ["loadfile", "'"$file"'", "append-play"] }' | nc -U /tmp/mpvsocket |