Hiiiii
This commit is contained in:
parent
4a7b5985a6
commit
57f9edbf56
8 changed files with 47 additions and 16 deletions
26
config/i3/multimediaKey
Executable file
26
config/i3/multimediaKey
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Send a key event to the current multimedia application or to MPD
|
||||
|
||||
# Currently since I did not found a way to test if a keystroke
|
||||
# is grabbed by a windows or not, we test if MPD is playing
|
||||
|
||||
echo 8 "$1" "$2" "$(xdotool getactivewindow)" >> /tmp/dbg
|
||||
|
||||
if [ $# != 2 ]; then
|
||||
echo "Usage: $0 KEY MPC_COMMAND"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $(mpc status | wc -l) -ne 1 ]; then
|
||||
# If mpd is running
|
||||
mpc $2
|
||||
else
|
||||
# If mpd is not running
|
||||
# echo "$1" "$2" "$(xdotool getactivewindow)" >> /tmp/dbg
|
||||
xdotool key --window $(xdotool getactivewindow) $1
|
||||
echo xdotool key --window $(xdotool getactivewindow) $1 >> /tmp/dbg
|
||||
fi
|
||||
exit 0
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue