899af6328b395f1db2e74d09880a1af435a188ca

Author
Benjamin Neff <benjamin@coding4coffee.ch>
Committer
GitHub <noreply@github.com>
Date

Message

fix(bgnotify): detect if sway is running and not just installed (#12989)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>

Diff

 1diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
 2index f6ffb6ed535d4b71ce18e154e886b9db5b281392..dca8250bec939ccf3e838cf553513e259dbc4150 100644
 3--- a/plugins/bgnotify/bgnotify.plugin.zsh
 4+++ b/plugins/bgnotify/bgnotify.plugin.zsh
 5@@ -62,7 +62,7 @@ function bgnotify_formatted {
 6 function bgnotify_appid {
 7   if (( ${+commands[osascript]} )); then
 8     osascript -e "tell application id \"$(bgnotify_programid)\"  to get the {id, frontmost, id of front window, visible of front window}" 2>/dev/null
 9-  elif [[ -n $WAYLAND_DISPLAY ]] && (( ${+commands[swaymsg]} )); then # wayland+sway
10+  elif [[ -n $WAYLAND_DISPLAY ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway
11     local app_id=$(bgnotify_find_sway_appid)
12     [[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
13   elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then