Skip to content

Instantly share code, notes, and snippets.

@lopesivan
Created May 18, 2022 02:26
Show Gist options
  • Save lopesivan/5a9ee41f5578f7f5bcd0e3ce1fe0f5cd to your computer and use it in GitHub Desktop.
Save lopesivan/5a9ee41f5578f7f5bcd0e3ce1fe0f5cd to your computer and use it in GitHub Desktop.
i3wm hide/show qutebrowser
#!/bin/sh
if xwininfo -tree -root | grep "qutebrowser";
then
echo "Window detected."
map_state=`xwininfo -all -id $(xdo id -N qutebrowser) | grep "Map State"| cut -d\s -f2`
# if [ "$map_state" = 'UnMapped' ];
if [ "$map_state" = 'Viewable' ];
then
xdo hide -N qutebrowser
else
xdo show -N qutebrowser
fi
else
echo "Window not detected... spawning."
i3 "exec --no-startup-id qutebrowser"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment