Created
May 18, 2022 02:26
-
-
Save lopesivan/5a9ee41f5578f7f5bcd0e3ce1fe0f5cd to your computer and use it in GitHub Desktop.
i3wm hide/show qutebrowser
This file contains hidden or 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/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