Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hide/show a maximized window matching the search expression in arg $1
#!/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