Notes on Configuring a Keyboard Shortcut to Close Notifications on Big Sur with Phoenix
Boon aka Hwee-Boon Yar
April 5, 2021
This is about configuring a keyboard shortcut (F12) to close notifications on Big Sur with Phoenix. I also use Phoenix in my tiling window manager.
Key.on('f12', [], function () { Task.run('/usr/local/bin/cliclick', ['m:1200,100'], null) Task.run('/usr/bin/osascript', ['-e', 'tell application "System Events"\n' + 'tell process "NotificationCenter"\n' + 'set this_item to window 1\n' + 'click button 1 of group 1 of UI element 1 of scroll area of this_item\n' + 'end tell\n' + 'end tell\n' + 'return\n'], null) })
2 things:
- This requires cliclick to be installed with brew install cliclick. Phoenix can probably control the cursor, but I ran out of time.
- You need to adjust the coordinators (1200,100 above) so it moves your cursor to be over the notification
Discussion in the ATmosphere