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: 8 months ago
JSON representation
Trigger macOS notifications from Alfred, using the Workflow icon
- Host: GitHub
- URL: https://github.com/vitorgalvao/notificator
- Owner: vitorgalvao
- License: unlicense
- Created: 2013-10-30T04:51:32.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-05-17T12:56:27.000Z (almost 2 years ago)
- Last Synced: 2024-12-11T19:17:00.213Z (over 1 year ago)
- Topics: alfred, jxa, macos, notifications, zsh
- Language: Shell
- Homepage:
- Size: 86.9 KB
- Stars: 169
- Watchers: 6
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred-test - vitorgalvao/notificator - Trigger macOS notifications from Alfred, using the Workflow icon (Shell)
README
# Notificator
Notificator is a command-line tool to show notifications from [Alfred](https://www.alfredapp.com) Workflows with their icon.


## Installation
Download the executable at the root of this repository and include it in your workflow.
## Usage
```
Trigger macOS notifications from Alfred, using the Workflow icon.
Message is mandatory. Other flags are optional.
Usage:
notificator --message [--title ] [--subtitle ] [--sound ]
Options:
-m, --message Message text.
-t, --title Title text.
-s, --subtitle Subtitle text.
-p, --sound Sound name (from /System/Library/Sounds).
-h, --help Show this help.
```
## 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 is run on a user’s machine, the app is seamlessly created to the Workflow’s cache directory and macOS prompts the user to allow notifications. On subsequent runs, the cached app is 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.