Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vitorgalvao/notificator

Trigger macOS notifications from Alfred, using the Workflow icon
https://github.com/vitorgalvao/notificator

alfred jxa macos notifications zsh

Last synced: about 2 months ago
JSON representation

Trigger macOS notifications from Alfred, using the Workflow icon

Awesome Lists containing this project

README

        

# Notificator

macOS tool unencumbered by licenses to show notifications from [Alfred](https://www.alfredapp.com) Workflows with their icon.

## Usage

Include the `notificator` script in your Alfred Workflow and call it with the relevant options:

```zsh
./notificator --title 'This is a notification' --subtitle 'It has a subtitle' --message 'And plays a sound' --sound 'Frog'
```

`--message` is mandatory but the other flags are optional. Use `--help` to see what is available.

## How it works

While it is possible to trigger notifications from AppleScript, those show a generic icon. To have a custom icon in full view, an app is required.

Notificator’s purpose is to create these small specialised apps. The icon is extracted from the Workflows’s root directory and the bundle identifier is derived from the Workflow’s—it is cleaned up and `.notificator` is appended.

The first time the script in run on a user’s machine, the app will be seamlessly created to the Workflow’s cache directory and macOS will prompt the user to allow notifications. On subsequent runs, the cached app will be run directly. The app is rebuilt if it is over a month old at the time of the notification, to refresh outdated icons.

## Prohibitory Symbol

[A macOS bug](https://web.archive.org/web/20230615021755/https://macmule.com/2021/10/28/notifications-showing-a-prohibitory-symbol-after-upgrading-macos-monterey/) may cause notifications to show a prohibitory symbol on top of the app icon. Logout or restart macOS to fix it.