i3 config overhaul AGAIN

This commit is contained in:
Wryn Wagner
2020-09-23 16:19:23 -06:00
parent 8b09c44ee7
commit cae7518746
25 changed files with 146 additions and 363 deletions

View File

@ -0,0 +1,26 @@
#
# Chrome / YouTube only accepts keypresses when window is active
#
# This activates the YouTube window, sends the keypress, then reactivates the original window
#
xdotool search --name 'YouTube Music' >/dev/null 2>&1 || return 1;
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';;
*) KEY_COMMAND='space';;
esac
xdotool search --name 'YouTube Music' windowactivate;
sleep $TIMEOUT;
xdotool key --clearmodifiers "$KEY_COMMAND";
xdotool set_desktop "$ACTIVE_DESKTOP";
[[ "$ACTIVE_WINDOW_NAME" != "Desktop" ]] && xdotool windowactivate "$ACTIVE_WINDOW_ID";

View File

@ -0,0 +1 @@
"$HOME/.wryn/bin/desktop/youtube-music/controller.sh" next

View File

@ -0,0 +1 @@
"$HOME/.wryn/bin/desktop/youtube-music/controller.sh" playpause

View File

@ -0,0 +1 @@
"$HOME/.wryn/bin/desktop/youtube-music/controller.sh" prev