Commit Graph

33 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño) d07785959c notification: Add support for getting actions activation token
Notification actions can now be activated with an activation token
containing platform data. So update the notification-spec to include
latest version of the specification, and expose the activation token
during an action activation.

Not to change the API, by modifying the type of NotifyActionCallback
it's just better to provide a function to fetch the activation token
during activation only, so that this can be retro-compatible.

Reference: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/b9a4700
2022-04-27 18:02:20 +02:00
Marco Trevisan (Treviño) 47400a2ff7 notify-send: Clear errors that could be re-used
We're using error variable multiple times, and this may lead to problems
when trying to set it again. So let's just clear once it's used.
2022-04-25 22:23:40 +02:00
Ben Blain 12d4b90623 notify-send: Check for notification server actions capability support 2022-04-25 22:23:40 +02:00
Ben Blain 6c707d2dfd notify-send: Add support for notification actions and responses
The activated action name is written to stdout and the notification is closed
when a valid action has been selected.
2022-04-25 22:23:37 +02:00
Ben Blain a396dd9af9 notify-send: Add option to wait until notification has been closed
If an expiration timeout is set, the notification is not waited longer
than such time.
2022-04-25 22:15:50 +02:00
Paul Collins 652b4d6911 notify-send: Support for replacing an existing notification
Support printing and overriding notification ID, so that it's possible
to replace a notification that is currently showing with an updated
content.

Based on patch as provided by Paul Collins in the following bug
report:
  https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/257135/comments/8

Co-authored-by: Marco Trevisan (Treviño) <mail@3v1n0.net>

Fixes #19
2022-04-25 19:42:13 +02:00
Ray Strode a228f1e84d notify-send: Give failing exit code if showing notification fails
Right now notify-send will quietly return a successful exit status
even if showing the notification fails.

This commit changes the behavior to instead fail on failure.

https://gitlab.gnome.org/GNOME/libnotify/-/merge_requests/13
2021-05-14 13:55:53 -04:00
Thorsten Wißmann dfaa76109e notify-send: Support commas in icon filenames
Do not cut off an icon filename (passed to -i) at the first comma
character. The original motivation probably was to support a list of
icon names in -i separated by comma. However, this has never been
implemented and the help text for -i also only mentions "an icon".

Hence, no functionality is lost by this change. In contrast, -i now
supports commas in icon filepaths.

https://gitlab.gnome.org/GNOME/libnotify/-/issues/16
2021-03-26 16:52:49 +01:00
Jan Tojnar a599a04de6
Drop Autotools 2020-01-13 17:09:17 +01:00
Marco Trevisan (Treviño) 9862ab85e8
notify-send: allow passing colon as hint value
While some hints like image-path or sound-file supports parameters using the
file:// protocol, it's impossible to pass such hints to notify-send, because
it splits the passed argument so that it can have an unlimited number of colons,
while only 3 should be there (as per TYPE:NAME:VALUE format).

So, make `g_strsplit` to accept only 3 tokens as maximum, while pass the
remaining parameters all-together.

So now it's possible to do
  notify-send -h string:image-path:file:///usr/share/icons/foo.png
2019-02-15 12:54:39 +00:00
Marco Trevisan 593f260722 Build with meson and add CI 2019-01-31 17:15:27 +00:00
Emmanuele Bassi 43aac613f1 Conditionall call g_type_init() after a version check
There's no need to call g_type_init() since GLib 2.36, so let's hide it
when building against newer versions of GLib.
2017-07-17 10:16:06 +01:00
Ting-Wei Lan 5398ecfe3f notify-send: Call setlocale in main function
It is required to correctly show translated messages on some locales.

https://bugzilla.gnome.org/show_bug.cgi?id=760438
2016-10-22 11:32:36 +08:00
Jasper St. Pierre b873c61ecc notify-send: Add ability to set app name 2011-10-12 17:31:29 -04:00
William Jon McCann ff1941aa9e Make notify-send always die on warnings 2010-11-15 14:56:32 -05:00
William Jon McCann 27e05d0f95 Remove the ability to attach notifications to widgets or positions 2010-10-08 22:47:06 -04:00
William Jon McCann eca356030f Various cleanups 2010-06-24 02:53:16 -04:00
William Jon McCann 9fae4e8c01 Sending NULL body is allowed 2010-06-23 20:28:59 -04:00
William Jon McCann 3806c8e7f9 Replace escape characters with g_strcompress in body
https://bugzilla.gnome.org/show_bug.cgi?id=613999
2010-04-02 20:20:24 -04:00
William Jon McCann 80952af10e Add pango's .gitignore generation foo 2010-01-31 14:33:46 -05:00
William Jon McCann 4db61ddb45 Use a consistent style 2010-01-29 04:35:35 -05:00
William Jon McCann 8374438dcf Fix indentation 2010-01-09 13:00:58 -05:00
Christian Hammond b8b9eecf5c Relicense notify-send under the LGPL in order to keep licensing simple and to allow reuse in more projects. Fixes bug #124. 2007-08-26 01:08:34 +00:00
Christian Hammond 870f6923ab Use fprintf instead of g_warning. 2006-04-21 22:35:52 +00:00
Christian Hammond d4768ac937 Patch by M.S. to switch notify-send to use GOption instead of popt, to add -v, --version, -h, and --hint options, and to rename -T, --type to -c, --category. This also fixes assertions when calling notify-send "". This closes ticket #41. 2006-04-21 21:27:46 +00:00
Christian Hammond 30961cc1a6 - Change the help for notify-send to indicate that --expire-timeout requires milliseconds, not seconds. This fixes bug #28.
- Fixed the short flag for --type to be -T. This fixes bug #18.
2006-03-20 22:17:10 +00:00
Christian Hammond 69547a286e Fix notify-send on PPC. 2006-03-18 22:48:08 +00:00
Christian Hammond ab651643eb Remove notify_notification_show_and_forget(). It's less confusing to have one show function, and require that the user unref. It also simplifies the code quite a bit. 2006-01-20 10:19:44 +00:00
Christian Hammond 85342c8619 - Fix some weird argument ordering in the calls to dbus_g_proxy_call_*().
- Re-order the arguments as per the spec.
- Change NOTIFY_TIMEOUT_* to NOTIFY_EXPIRES_*.
- Update the spec to 0.9.
2006-01-20 10:00:32 +00:00
Christian Hammond 3b0e8d2986 Make notify-send work again when a body isn't specified. 2006-01-19 09:35:17 +00:00
Christian Hammond 959eeb5bcd Fix some C99 usage. 2006-01-11 06:56:38 +00:00
John (J5) Palmieri 5cd10607b1 * Release 0.3.0
* tests/Makefile.am, tools/Makefile.am: patch from Rodney
  Dawes <dobey at novell.com> fixing make distcheck

* tools/notify-send.c: use show_and_forget
2005-12-13 22:42:48 +00:00
John (J5) Palmieri 6017d6af7b First import of the next generation libnotify API 2005-11-10 19:18:10 +00:00