File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -319,12 +319,13 @@ ctrl - s : scroll
319319
320320Read more about [ CLI Usage] ( #%EF%B8%8F-cli-usage ) .
321321
322- #### Enable Menu Bar and Dock Hints
322+ #### Enable Menu Bar Dock and Notification Center Hints
323323
324324``` toml
325325[general ]
326326include_menubar_hints = true
327327include_dock_hints = true # Also includes Mission Control
328+ include_nc_hints = true # Notification popups
328329```
329330
330331#### Restore cursor after click action
Original file line number Diff line number Diff line change @@ -423,6 +423,16 @@ func (a *App) activateHintMode(withActions bool) {
423423 }
424424 }
425425
426+ // Optionally include Notification Center elements
427+ if a .config .General .IncludeNCHints {
428+ if ncElems , derr := accessibility .GetNCClickableElements (); derr == nil {
429+ elements = append (elements , ncElems ... )
430+ a .logger .Debug ("Included nc elements" , zap .Int ("count" , len (ncElems )))
431+ } else {
432+ a .logger .Warn ("Failed to get nc elements" , zap .Error (derr ))
433+ }
434+ }
435+
426436 if len (elements ) == 0 {
427437 a .logger .Warn ("No clickable elements found" )
428438 return
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ excluded_apps = []
2828include_menubar_hints = false
2929# Show hints on the Dock (includes mission control)
3030include_dock_hints = false
31+ # Show hints on the Notification Center
32+ include_nc_hints = false
3133
3234# Restore cursor position after action
3335# Restore cursor position after left click
Original file line number Diff line number Diff line change @@ -189,3 +189,32 @@ func GetDockClickableElements() ([]*TreeNode, error) {
189189 }
190190 return tree .FindClickableElements (), nil
191191}
192+
193+ // GetNCClickableElements returns clickable elements from the Notification Center
194+ func GetNCClickableElements () ([]* TreeNode , error ) {
195+ nc := GetApplicationByBundleID ("com.apple.notificationcenterui" )
196+ if nc == nil {
197+ return []* TreeNode {}, nil
198+ }
199+ defer nc .Release ()
200+
201+ opts := DefaultTreeOptions ()
202+ opts .IncludeOutOfBounds = true
203+ opts .CheckOcclusion = false
204+ opts .MaxDepth = 8
205+ opts .FilterFunc = func (info * ElementInfo ) bool {
206+ if info .Size .X < 6 || info .Size .Y < 6 {
207+ return false
208+ }
209+ return true
210+ }
211+
212+ tree , err := BuildTree (nc , opts )
213+ if err != nil {
214+ return nil , err
215+ }
216+ if tree == nil {
217+ return []* TreeNode {}, nil
218+ }
219+ return tree .FindClickableElements (), nil
220+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ type GeneralConfig struct {
2525 ExcludedApps []string `toml:"excluded_apps"`
2626 IncludeMenubarHints bool `toml:"include_menubar_hints"`
2727 IncludeDockHints bool `toml:"include_dock_hints"`
28+ IncludeNCHints bool `toml:"include_nc_hints"`
2829 RestorePosAfterLeftClick bool `toml:"restore_pos_after_left_click"`
2930 RestorePosAfterRightClick bool `toml:"restore_pos_after_right_click"`
3031 RestorePosAfterMiddleClick bool `toml:"restore_pos_after_middle_click"`
@@ -108,6 +109,7 @@ func DefaultConfig() *Config {
108109 ExcludedApps : []string {},
109110 IncludeMenubarHints : false ,
110111 IncludeDockHints : false ,
112+ IncludeNCHints : false ,
111113 RestorePosAfterLeftClick : false ,
112114 RestorePosAfterRightClick : false ,
113115 RestorePosAfterMiddleClick : false ,
You can’t perform that action at this time.
0 commit comments