Notes on Configuring a Keyboard Shortcut to Close Notifications on Big Sur with Phoenix
This is about configuring a keyboard shortcut (F12
) to close notifications on Big Sur with Phoenix.
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 withbrew 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