{
  "$type": "site.standard.document",
  "path": "/keyboard-shortcut-phoenix-close-notification-big-sur/",
  "publishedAt": "2021-04-05T17:36:00.000Z",
  "site": "at://did:plc:bryys25pc2fnagnyxqgsglhd/site.standard.publication/3mn26bjkkmh23",
  "tags": [
    "Scripts",
    "macOS",
    "Tools"
  ],
  "textContent": "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.\n\nKey.on('f12', [], function () {\n  Task.run('/usr/local/bin/cliclick', ['m:1200,100'], null)\n  Task.run('/usr/bin/osascript',\n    ['-e', 'tell application \"System Events\"\\n' +\n      'tell process \"NotificationCenter\"\\n' +\n      'set this_item to window 1\\n' +\n      'click button 1 of group 1 of UI element 1 of scroll area of this_item\\n' +\n      'end tell\\n' +\n      'end tell\\n' +\n      'return\\n'], null)\n})\n\n2 things:\n\n 1. This requires cliclick to be installed with brew install cliclick. Phoenix can probably control the cursor, but I ran out of time.\n 2. You need to adjust the coordinators (1200,100 above) so it moves your cursor to be over the notification",
  "title": "Notes on Configuring a Keyboard Shortcut to Close Notifications on Big Sur with Phoenix"
}