Fixes an ugly libdbus assertion with --server-info and --server-capabilities, when the notification daemon doesn't reply. |
||
|---|---|---|
| completions | ||
| doc | ||
| CHANGELOG.md | ||
| generate-version.sh | ||
| LICENSE | ||
| main.c | ||
| meson.build | ||
| meson_options.txt | ||
| PKGBUILD | ||
| README.md | ||
FYI
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-senddoes not implement--close.notify-senddoes not expose activation tokens (needed for window focus/activation) in any meaningful way. It prints it as a debug message whenG_MESSAGES_DEBUG=all;fyiprints it when you use--print-token.fyihas consistent syntax in its--actionand--hintoptions.fyican print the reason a notification was closed, with--print-reason.fyican query the notification daemon for its name and version information.fyican query the notification daemon for its capabilities.fyihas shell completions (bash and fish).fyihas 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