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

https://github.com/crabvk/notify-call

Command-line tool to send desktop notifications and handle actions
https://github.com/crabvk/notify-call

desktop-notifications notify-send

Last synced: 3 months ago
JSON representation

Command-line tool to send desktop notifications and handle actions

Awesome Lists containing this project

README

          

# 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](https://www.mankier.com/1/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 ` 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

```shell
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](https://github.com/vlevit/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](https://github.com/crabvk/notify-call/releases) and

```shell
cargo build --release --locked
```

will build target/release/notify-call.

## Desktop Notifications Specification

- https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html
- https://developer.gnome.org/notification-spec/