401b46c886
Rules watch every notification for words and apps and answer with an effect: nudge, flash, banner, airplane, confetti, blink, sound, focus, or a command. Silenced notifications that match a rule are let through. Settings popup behind a bar bell, rules kept in one JSON file.
10 lines
378 B
Bash
Executable File
10 lines
378 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Runs a shell command of yours, with the notification in the environment
|
|
# (AR_APP, AR_SUMMARY, AR_BODY, AR_RULE, ...; see bin/ar-effect).
|
|
#
|
|
# {"type": "command", "run": "notify-send \"$AR_RULE\" \"$AR_SUMMARY\""}
|
|
set -uo pipefail
|
|
[[ -n ${AR_OPT_RUN:-} ]] || { echo "command: the effect needs a \"run\" option" >&2; exit 2; }
|
|
exec bash -c "$AR_OPT_RUN"
|