aboutsummaryrefslogtreecommitdiff
path: root/pauseallmpv
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-07-31 11:55:21 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-07-31 11:55:21 +0200
commitfa666dcdde6bc0b5801b6bdd2e4a5c9afb0cfe6a (patch)
tree1a77f94ca7e8d8b630ca8b35911f186645836d51 /pauseallmpv
parentf832d43206035e4101472a1d07d261952dfdd85d (diff)
downloadscripts-fa666dcdde6bc0b5801b6bdd2e4a5c9afb0cfe6a.tar.gz
scripts-fa666dcdde6bc0b5801b6bdd2e4a5c9afb0cfe6a.zip
pauseallmpv now accepts a key name as argument to use instead of the default comma.
Diffstat (limited to 'pauseallmpv')
-rwxr-xr-xpauseallmpv6
1 files changed, 5 insertions, 1 deletions
diff --git a/pauseallmpv b/pauseallmpv
index 7c3406f..9ef0e9d 100755
--- a/pauseallmpv
+++ b/pauseallmpv
@@ -1,8 +1,12 @@
#!/bin/sh
+key=$1
+
+[ -z "$key" ] && key='comma'
+
# From Luke Smith
#for i in $(ls /tmp/mpvsoc*); do
# echo '{ "command": ["set_property", "pause", true] }' | socat - "$i";
#done
-xdotool search --class mpv | xargs -I % xdotool key --window % comma
+xdotool search --class mpv | xargs -I % xdotool key --window % "$key"