dotfiles/scripts/qblof
2022-01-03 12:30:57 -06:00

39 lines
830 B
Bash
Executable file

#!/bin/sh
# Check to see if firefox is running
if pgrep -x qutebrowser > /dev/null; then
echo "qb running"
if [ $XDG_SESSION_TYPE = "x11" ]; then
#X11
echo "X11"
qbrg=$(wmctrl -lx | rg qutebrowser | awk '{print $1}')
# echo $emacsrg
if [ -z $qbrg ]; then
qutebrowser
exit
else
wmctrl -ia $qbrg
exit
fi
else
if [ $KDE_FULL_SESSION = "true" ]; then
ww -f org.qutebrowser.qutebrowser -c qutebrowser
exit
else
# WAYLAND
qbrg=$(wlrctl window list | rg qutebrowser)
qbwin=$(echo $qbrg | sed 's/.*\: //')
# echo $ffwin
wlrctl toplevel focus title:"$qbwin"
exit
fi
fi
else
qutebrowser
fi