notify-send alternative
Find a file
Daniel Eklöf 1a35bcc342
main: don't unref a NULL DBusMessage
Fixes an ugly libdbus assertion with --server-info and
--server-capabilities, when the notification daemon doesn't reply.
2024-10-02 07:44:26 +02:00
completions completions: fish: add image-{data,size} 2024-08-09 08:30:38 +02:00
doc doc: highlight referenced option 2024-09-05 07:11:33 +02:00
CHANGELOG.md main: don't unref a NULL DBusMessage 2024-10-02 07:44:26 +02:00
generate-version.sh generate version string at build time 2024-07-26 16:17:43 +02:00
LICENSE doc: add LICENSE (MIT) and man page 2024-07-26 16:18:16 +02:00
main.c main: don't unref a NULL DBusMessage 2024-10-02 07:44:26 +02:00
meson.build meson+pkgbuild: bump version to 1.0.4 2024-09-05 08:39:53 +02:00
meson_options.txt doc: add LICENSE (MIT) and man page 2024-07-26 16:18:16 +02:00
PKGBUILD meson+pkgbuild: bump version to 1.0.4 2024-09-05 08:39:53 +02:00
README.md readme: add repology package status 2024-08-20 09:09:51 +02:00

FYI

Packaging status

FYI (for your information) is a command line utility to send desktop notifications to the user via a notification daemon implementing XDG desktop notifications.

It is a almost a notify-send clone, with the following differences:

  • notify-send does not implement --close.
  • notify-send does not expose activation tokens (needed for window focus/activation) in any meaningful way. It prints it as a debug message when G_MESSAGES_DEBUG=all; fyi prints it when you use --print-token.
  • fyi has consistent syntax in its --action and --hintoptions.
  • fyi can print the reason a notification was closed, with --print-reason.
  • fyi can query the notification daemon for its name and version information.
  • fyi can query the notification daemon for its capabilities.
  • fyi has shell completions (bash and fish).
  • fyi has a single run-time dependency: dbus (the original D-Bus implementation).

Examples

Display a notification:

fyi 'This is the title' this is the notification message

Display a notification with a custom app-name (typically displays an icon too):

fyi --app-name firefox notification is this from firefox...

Display a notification with a custom app-name and another icon:

fyi --app-name firefox -i chromium notification firefox or chromium...

Print notification ID, and wait for notification to close:

fyi --print-id --wait title message

prints

id=7

Close the notification sent above:

fyi --close 7

or, press ctrl+c; this will send SIGINT to fyi, which will close the notification.

Add two actions (then trigger one of them):

fyi --action default:'Click to activate' --action no:Nope title message

prints

action=default (or no)

Print ID, close reason and activation token:

fyi --print-id --print-reason --print-token --action default:'Click to activate' \
    title message

prints

id=5
xdgtoken=24c1d76038357e75ec04f27e30ef46bb
action=default
reason=dismissed

Set a custom image, in addition to the application icon (note: not all notification daemons support showing both an icon and an image, and will select one of them):

fyi --icon firefox --hint string:image-path /path/to/image.png title message

Set a custom image in-band. Same limitations to icon vs. image as above. The image file must be raw RGBA pixels. I.e. you cannot use a plain PNG, or SVG etc. You can use convert (from ImageMagick) to convert e.g. a PNG. Since the file contains no metadata, you also need to tell fyi the image's dimensions:

# Get image dimensions
file /path/to/image.png

# Convert to raw RGBA
convert /path/to/image.png /path/to/raw.rgba

# Notify!
fyi --image-data /path/to/raw.rgba --image-size WxH title message