Skip to content

Command-line tool to send desktop notifications and handle actions

License

Notifications You must be signed in to change notification settings

crabvk/notify-call

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TODO

  • random IDs => fixes bug
  • optionally close notification after successful action command execution

notify-call

A command-line tool to send desktop notifications and handle actions via D-Bus on Linux.
It's similar to notify-send with additional features.

Install

On ArchLinux https://aur.archlinux.org/packages/notify-call/

Additional to notify-send features

  • Replace notification by ID
  • Use a temporary file to store and replace notification

-R, --replace-file <FILE> saves notification ID and replaces notification on next run.
It stores files in XDG_RUNTIME_DIR (usually /run/user/1000) or /tmp if XDG_RUNTIME_DIR is not set. You can also specify an absolute path.

  • Set default and custom notification actions
notify-call -d 'echo example' -o 'echo action1:one' -o 'echo action2:two' hello actions

The default action is usually triggered on the left click.

How it's different from notify-send.sh

  • It is faster, which matters with multiple sequential calls (like when you increase or decrease system volume)
  • Can handle actions several times until you close the notification

Build

Download latest release and

cargo build --release --locked

will build target/release/notify-call.

Desktop Notifications Specification