Created
June 5, 2017 19:33
-
-
Save mikeshardmind/1ae295a58d5f8768b1fa8758aeff0823 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Dofus Window Switcher | |
#Usage: With no parameters, attempts to switch to a flashing dofus window. | |
#With a parameter, switch to the window with that title | |
if [ -z $1 ] ; then | |
for id in `xdotool search --class "Dofus"`; do | |
xprop -id $id | grep "The urgency hint bit is set" > /dev/null 2>&1 | |
if [ "$?" = "0" ]; then | |
wmctrl -i -a $id | |
exit 0 | |
fi | |
done | |
fi | |
if [ ! -z $1 ] ; then | |
xdotool search --name $1 windowactivate | |
exit 0 | |
fi | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where do i need to set the keybind? How can i run this code ? any help ?