mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-03-03 21:10:28 +08:00
fix(bgnotify): detect if sway is running and not just installed
Before it also tried to call swaymsg if running on another wayland compositor, but sway was also installed. The fix is to also check for the $SWAYSOCK variable, which swaymsg is using to check where to talk to sway. So it only tries to run swaymsg if sway is actually running.
This commit is contained in:
parent
6e7ac0544e
commit
c106934235
@ -62,7 +62,7 @@ function bgnotify_formatted {
|
||||
function bgnotify_appid {
|
||||
if (( ${+commands[osascript]} )); then
|
||||
osascript -e "tell application id \"$(bgnotify_programid)\" to get the {id, frontmost, id of front window, visible of front window}" 2>/dev/null
|
||||
elif [[ -n $WAYLAND_DISPLAY ]] && (( ${+commands[swaymsg]} )); then # wayland+sway
|
||||
elif [[ -n $WAYLAND_DISPLAY ]] && [[ -n $SWAYSOCK ]] && (( ${+commands[swaymsg]} )); then # wayland+sway
|
||||
local app_id=$(bgnotify_find_sway_appid)
|
||||
[[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
|
||||
elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then
|
||||
|
Loading…
Reference in New Issue
Block a user