From ab7c03e8b80b83a7d78872d0e0f8cb8b9796e470 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Tue, 15 Sep 2020 13:26:28 -0600 Subject: [PATCH] Computer too slow for .05 second timeout on youtube media controls. Upped the timeout (and moved it to a var) --- bin/youtube-media-controls.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/youtube-media-controls.sh b/bin/youtube-media-controls.sh index 9c1df4e..57ae275 100755 --- a/bin/youtube-media-controls.sh +++ b/bin/youtube-media-controls.sh @@ -10,6 +10,8 @@ ACTIVE_DESKTOP="$(xdotool get_desktop)" ACTIVE_WINDOW_ID="$(xdotool getactivewindow)" ACTIVE_WINDOW_NAME="$(xdotool getwindowname $ACTIVE_WINDOW_ID)" +TIMEOUT='0.1'; + case $1 in next) KEY_COMMAND='j';; prev) KEY_COMMAND='k';; @@ -17,7 +19,7 @@ case $1 in esac xdotool search --name 'YouTube Music' windowactivate; -sleep 0.05; +sleep $TIMEOUT; xdotool key --clearmodifiers "$KEY_COMMAND"; xdotool set_desktop "$ACTIVE_DESKTOP";