diff options
| author | Carlo Sala <carlosalag@protonmail.com> | 2023-11-22 15:22:36 +0100 |
|---|---|---|
| committer | Carlo Sala <carlosalag@protonmail.com> | 2023-11-22 15:22:36 +0100 |
| commit | 18073af622703a8aca28c630614d13d2f50d30fe (patch) | |
| tree | 541be6f0ab399f44e3861f05b288f7be26162c8c /plugins/bgnotify/bgnotify.plugin.zsh | |
| parent | e6a1db213d66efdaec00469e58d4f9f3f2a78bd0 (diff) | |
| download | zsh-18073af622703a8aca28c630614d13d2f50d30fe.tar.gz zsh-18073af622703a8aca28c630614d13d2f50d30fe.tar.bz2 zsh-18073af622703a8aca28c630614d13d2f50d30fe.zip | |
fix(bgnotify): detect properly if `swaymsg` is installed
Closes #12053
Diffstat (limited to 'plugins/bgnotify/bgnotify.plugin.zsh')
| -rw-r--r-- | plugins/bgnotify/bgnotify.plugin.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index 9ad989c0b..493a20815 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -63,10 +63,10 @@ function bgnotify_appid { if (( ${+commands[osascript]} )); then # output is "app ID, window ID" (com.googlecode.iterm2, 116) osascript -e 'tell application (path to frontmost application as text) to get the {id, id of front window}' 2>/dev/null - elif [[ -n $WAYLAND_DISPLAY && ${+commands[swaymsg]} && ${+commands[jq]} ]]; then # wayland+sway + elif [[ -n $WAYLAND_DISPLAY ]] && (( ${+commands[swaymsg]} )) && (( ${+commands[jq]} )); then # wayland+sway # output is "app_id, container id" (Alacritty, 1694) swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | {app_id, id} | join(", ")' - elif [[ -n $DISPLAY && ${+commands[xprop]} ]]; then + elif [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then xprop -root _NET_ACTIVE_WINDOW 2>/dev/null | cut -d' ' -f5 else echo $EPOCHSECONDS |
