Skip to content

Instantly share code, notes, and snippets.

@fooblahblah
Created July 24, 2018 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fooblahblah/db8b5fc2bbc91fec4a42c9ab7911acbd to your computer and use it in GitHub Desktop.
Save fooblahblah/db8b5fc2bbc91fec4a42c9ab7911acbd to your computer and use it in GitHub Desktop.
Script to raise and lower a window quake-style
#!/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