Created
May 18, 2022 02:22
-
-
Save lopesivan/47ab0c41663d34fc03024b51fd974836 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" = 'Viewable' ]; | |
then | |
echo "Window detected." | |
xdo hide -N qutebrowser | |
else | |
echo "Window not detected... spawning." | |
xdo show -N qutebrowser | |
fi | |
else | |
i3 "exec --no-startup-id qutebrowser" | |
fi | |
# if [ "$map_state" = 'UnMapped' ]; | |
# then | |
# echo "Window not detected... spawning." | |
# xdo show -N qutebrowser | |
# fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment