Created
July 24, 2018 15:31
-
-
Save fooblahblah/db8b5fc2bbc91fec4a42c9ab7911acbd to your computer and use it in GitHub Desktop.
Script to raise and lower a window quake-style
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
#!/run/current-system/sw/bin/bash | |
SEARCHED_WINDOW=$1 | |
WINDOW_ID=$(xdotool search --classname $SEARCHED_WINDOW|tail -n 1) | |
VISIBLE_WINDOW_ID=$(xdotool search --onlyvisible --classname $SEARCHED_WINDOW|tail -n 1) | |
if [ -z "$VISIBLE_WINDOW_ID" ]; then | |
xdotool windowmap $WINDOW_ID | |
xdotool windowsize $WINDOW_ID 100% 100% | |
xdotool windowactivate $WINDOW_ID | |
else | |
xdotool windowunmap $VISIBLE_WINDOW_ID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment