mpv config: use mpvSockets script to remove mpv wrappers/aliases (#544)

* add scripts to mpv's cfg \w mpvSockets as 1st dependency and\or script

* remove all usage of --input-ipc-server in all cmds

* remove mpv alias that adds --input-ipc-server

* fix pauseallmpv: correct paths to unix socket files

* fix dependency-scripts loading so it works also when opening files off main disk
This commit is contained in:
Wis
2020-04-09 04:35:03 +03:00
committed by GitHub
parent 11eac2294f
commit a08904d88a
10 changed files with 24 additions and 20 deletions

View File

@@ -6,11 +6,11 @@
case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in
"copy url") echo "$1" | xclip -selection clipboard ;;
mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
"mpv (loop)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet --loop "$1" >/dev/null 2>&1 & ;;
"mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;;
"queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;;
"queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;;
browser) setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;;
feh) setsid feh "$1" >/dev/null 2>&1 & ;;
w3m) w3m "$1" >/dev/null 2>&1 ;;
"mpv (float)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;;
"mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;;
esac

View File

@@ -11,7 +11,7 @@
case "$1" in
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*)
setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;;
setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
*png|*jpg|*jpe|*jpeg|*gif)
curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;;
*mp3|*flac|*opus|*mp3?source*)

View File

@@ -5,6 +5,6 @@
# every single one of them with one command! This is bound to super + shift + p
# (with other things) by default and is used in some other places.
for i in $(ls /tmp/mpvsoc*); do
for i in $(ls /tmp/mpvSockets/*); do
echo '{ "command": ["set_property", "pause", true] }' | socat - $i;
done