Use herbstclient if available for focusing

This commit is contained in:
Jeremy Gardais 2020-12-02 20:02:35 +01:00
parent 096c505479
commit 894fe548ff
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 13 additions and 3 deletions

16
qb
View File

@ -199,9 +199,19 @@ focus_to_qutebrowser() { # {{{
debug_message "focus_to_qutebrowser \ debug_message "focus_to_qutebrowser \
Qutebrowser window ID: ${RED}${qutebrowser_window_id}${COLOR_DEBUG} on desktop ID: ${RED}${qutebrowser_desktop_id}${COLOR_DEBUG}." Qutebrowser window ID: ${RED}${qutebrowser_window_id}${COLOR_DEBUG} on desktop ID: ${RED}${qutebrowser_desktop_id}${COLOR_DEBUG}."
## Switch to Qutebrowser desktop and first window ## If HerstluftWM is available
command wmctrl -s "${qutebrowser_desktop_id}" if [ "$(command -v herbstclient)" ]; then
command wmctrl -i -R "${qutebrowser_window_id}" debug_message "focus_to_qutebrowser \
Focus with herbstclient."
### Direct focus to the window id
herbstclient jumpto "${qutebrowser_window_id}"
else
debug_message "focus_to_qutebrowser \
Focus with wmctrl."
### Switch to Qutebrowser desktop and expected window
command wmctrl -s "${qutebrowser_desktop_id}"
command wmctrl -i -R "${qutebrowser_window_id}"
fi
} }
# }}} # }}}