summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Dovhan <denysdovhan@gmail.com>2025-09-19 16:39:50 +0300
committerGitHub <noreply@github.com>2025-09-19 15:39:50 +0200
commit2b2d6d746ca3ed6dfac26be331e49fa80a1191ab (patch)
treef315394c870686c9d653e898a44f8dd72e4a9ceb
parent9e23925b8581d22033f07f1983587412d3761494 (diff)
downloadzsh-2b2d6d746ca3ed6dfac26be331e49fa80a1191ab.tar.gz
zsh-2b2d6d746ca3ed6dfac26be331e49fa80a1191ab.tar.bz2
zsh-2b2d6d746ca3ed6dfac26be331e49fa80a1191ab.zip
fix(bgnotify): use lsappinfo, add support for ghostty (#13314)
-rw-r--r--plugins/bgnotify/bgnotify.plugin.zsh7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
index dca8250be..4c1613eed 100644
--- a/plugins/bgnotify/bgnotify.plugin.zsh
+++ b/plugins/bgnotify/bgnotify.plugin.zsh
@@ -60,8 +60,10 @@ 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
+ if (( ${+commands[lsappinfo]} )); then
+ lsappinfo info -only bundleid "$(lsappinfo front)" | awk -F= '{print $2}' | tr -d '"' 2>/dev/null
+ elif (( ${+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 ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway
local app_id=$(bgnotify_find_sway_appid)
[[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
@@ -108,6 +110,7 @@ function bgnotify_programid {
case "$TERM_PROGRAM" in
iTerm.app) echo 'com.googlecode.iterm2' ;;
Apple_Terminal) echo 'com.apple.terminal' ;;
+ ghostty) echo 'com.mitchellh.ghostty' ;;
esac
}