mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-04-28 01:03:30 +02:00
feat(bgnotify): add niri WM support (#13707)
This commit is contained in:
@@ -67,6 +67,9 @@ function bgnotify_appid {
|
||||
elif [[ -n $WAYLAND_DISPLAY ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway
|
||||
local app_id=$(bgnotify_find_sway_appid)
|
||||
[[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
|
||||
elif [[ -n $NIRI_SOCKET ]]; then # niri
|
||||
local app_id=$(bgnotify_find_niri_appid)
|
||||
[[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
|
||||
elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then
|
||||
xprop -root _NET_ACTIVE_WINDOW 2>/dev/null | cut -d' ' -f5
|
||||
else
|
||||
@@ -106,6 +109,12 @@ function bgnotify_find_sway_appid {
|
||||
fi
|
||||
}
|
||||
|
||||
function bgnotify_find_niri_appid {
|
||||
if (( ${+commands[jq]} )); then
|
||||
niri msg -j windows | jq '.[] | select(.is_focused) | {app_id, id} | join(",")'
|
||||
fi
|
||||
}
|
||||
|
||||
function bgnotify_programid {
|
||||
case "$TERM_PROGRAM" in
|
||||
iTerm.app) echo 'com.googlecode.iterm2' ;;
|
||||
|
||||
Reference in New Issue
Block a user