mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2025-11-04 13:21:19 +08:00 
			
		
		
		
	fix(bgnotify): use lsappinfo, add support for ghostty (#13314)
This commit is contained in:
		
							parent
							
								
									9e23925b85
								
							
						
					
					
						commit
						2b2d6d746c
					
				@ -60,7 +60,9 @@ function bgnotify_formatted {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function bgnotify_appid {
 | 
					function bgnotify_appid {
 | 
				
			||||||
  if (( ${+commands[osascript]} )); then
 | 
					  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
 | 
					    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
 | 
					  elif [[ -n $WAYLAND_DISPLAY ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway
 | 
				
			||||||
    local app_id=$(bgnotify_find_sway_appid)
 | 
					    local app_id=$(bgnotify_find_sway_appid)
 | 
				
			||||||
@ -108,6 +110,7 @@ function bgnotify_programid {
 | 
				
			|||||||
  case "$TERM_PROGRAM" in
 | 
					  case "$TERM_PROGRAM" in
 | 
				
			||||||
    iTerm.app) echo 'com.googlecode.iterm2' ;;
 | 
					    iTerm.app) echo 'com.googlecode.iterm2' ;;
 | 
				
			||||||
    Apple_Terminal) echo 'com.apple.terminal' ;;
 | 
					    Apple_Terminal) echo 'com.apple.terminal' ;;
 | 
				
			||||||
 | 
					    ghostty) echo 'com.mitchellh.ghostty' ;;
 | 
				
			||||||
  esac
 | 
					  esac
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user