https://github.com/chanibal/toast
Notification utility for Windows, WSL, and MacOS
https://github.com/chanibal/toast
bash hacktoberfest macos notification notification-utility popup terminal windows
Last synced: 6 months ago
JSON representation
Notification utility for Windows, WSL, and MacOS
- Host: GitHub
- URL: https://github.com/chanibal/toast
- Owner: chanibal
- License: mit
- Created: 2020-09-03T11:18:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-12T23:54:28.000Z (over 5 years ago)
- Last Synced: 2025-02-07T21:32:54.819Z (over 1 year ago)
- Topics: bash, hacktoberfest, macos, notification, notification-utility, popup, terminal, windows
- Language: Shell
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Toast
=====
Notification utility for Windows bash (WSL, Cygwin, MSYS etc.) and MacOS.
Written in pure bash with plugins using other technologies (cURL, Powershell etc.).
Project homepage: https://github.com/chanibal/toast/
Usage
-----
Simple popup just with a subject:
```bash
toast "my message in the notification"
```
Popup with standard input printed:

```bash
date --iso-8601=s | toast "The current date and time"
```
All arguments are used as the message subject.
If the command is executed in a pipe, all of `stdin` is read.
Plugins and configuration
-------------------------
Toast is very simple to extend.
It will automatically find functions that start with `plugin_toast_...` and evaluate them with three arguments:
1. `subject` - the subject of the notification (the part that is the command line argument to the `toast` command)
2. `body` - the body of the notification (the optional part that is piped into the `toast` command)
3. `client` - the name of the current device, defaults to hostname
You can add your own plugin in the configuration file `~/.config/.toast` (supports `XDG_CONFIG_HOME` changes) or in your `.profile`/`.bash_profile`/other script executing on shell startup.
Example:
```bash
plugin_toast_example ()
{
local subject body client
subject="$1"
body="$2"
client="$3"
curl --silent --output /dev/null --show-error --fail -X POST \
--form-string subject="$subject" \
--form-string body="$body" \
--form-string client="$client" \
"http://example.com"
return $?
}
```
Available plugins
-----------------
Currently two plugins are built in
### `windows_notification`
Pops up a Windows 8/10 tray notification in the corner of your screen.
No additional configuration
### `ifttt`
Executes a IFTTT maker request. This is an easy way to link an Android popup using Pushbullet.
Configuration:
- `PLUGIN_TOAST_IFTTT_KEY` - the maker event key, required
- `PLUGIN_TOAST_IFTTT_EVENT` - the maker event name, defaults to `notification`.