Commit Graph

432 Commits

Author SHA1 Message Date
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
Marco Trevisan (Treviño) f9c1cf1b71 notification: Keep converted URIs as such when we prepend a path 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) 997e2e374a notification: Do not duplicate calls on parse functions 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) 0d86d8c8d5 notification: Improve debug logs when rewriting paths 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) b2d6712b15 notification: Avoid creating a new hint variant when nothing has changed 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) 961f45f44c notification: Use snap name and app name as fallback desktop-entry
Snaps use desktop IDs based on the snap name and the application name
inside the snap, so if we're in a such container, we need to compute the
desktop-entry using those values. We can figure them out from the snap
cgroup they're in.

In such case, don't even try to use the GApplication ID as that is
likely wrong in a snapped environment.
2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) e72396e8ca notification: Preserve snap details into the private struct
We may need to use them in various places, so there's no point to repeat
the same in multiple places, this way we can also use some shortcuts for
non-snap setups.
2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) d21b8140a8 notification: Do not try to append snap name to desktop when it's a path 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) c4d5ea8baf notification: Do not prepend SNAP prefix when is already present
We used to just add it again, to eventually figure out that the file
did not exists, but may not work properly in some scenarios.

Also always fill the path_filename when using a file-name only, as that
may be refer to something under the SNAP path, and in such case we want
to try check if that exists before giving up.
2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) d348a36a05 build: Do not require g-ir-scanner on introspection=auto 2022-04-21 23:53:44 +02:00
Marco Trevisan (Treviño) d5a888fa31 notification: Use g_memdup2 when available
It's not really an issue here, as we use a properly typed len, but
better not to use a deprecated and potentially dangerous API.
2022-04-21 23:53:44 +02:00
Marco Trevisan (Treviño) 736fcea1d0 build: Avoid warnings or mis-behavior in recent meson versions
In future meson will check the run_command result by default, while it's
fine for us, it would cause our nicer error message not to work.
2022-04-21 23:53:44 +02:00
Marco Trevisan (Treviño) 2accd4ceab Revert "Revert "Merge branch 'readme' into 'master'""
This reverts commit 1ad4630107.

As per: https://gitlab.gnome.org/GNOME/libnotify/-/commit/1ad46301#note_1434358
2022-04-21 18:51:13 +02:00
Corentin Noël 333f7c5d32 Send the application ID when possible 2022-04-21 16:35:38 +02:00
David King 7f31e29e62 docs: Use consistent IDs in spec build
This avoids differences between IDs for separate builds of the
specification.
2022-04-21 14:37:58 +02:00
Logan Rathbone 1ad4630107 Revert "Merge branch 'readme' into 'master'"
This reverts merge request !21
2022-03-21 22:19:32 +00:00
Logan Rathbone e35921f10f Merge branch 'readme' into 'master'
Add README clarifying status of libnotify

See merge request GNOME/libnotify!21
2022-03-21 22:15:16 +00:00
Maximiliano Sandoval R edb1dc8394
Add README clarifying status of libnotify
See discussions at https://gitlab.gnome.org/GNOME/libnotify/-/issues/20.

Based off https://gitlab.gnome.org/GNOME/libnotify/-/merge_requests/19
2022-03-14 17:50:55 +01: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
Marco Trevisan 05112e2a5b Merge branch 'update_documenation' into 'master'
Update documenation (generated man file) to express that plasma notification...

See merge request GNOME/libnotify!14
2021-04-06 11:59:19 +00:00
Alberts Muktupāvels 39575f7c6f Merge branch 'master' into 'master'
notify-send: Support commas in icon filenames

See merge request GNOME/libnotify!15
2021-03-26 15:57:33 +00: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
Alberts Muktupāvels 48e64c39bc Merge branch 'fix-ci' into 'master'
fix CI build stuck on TZ data config

See merge request GNOME/libnotify!16
2020-12-24 18:34:29 +00:00
Matthias Sweertvaegher 698a05fcc4 fix CI build stuck on TZ data config
when pushing a new commit, I noticed the CI build gets stuck on:

Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
  1. Africa   3. Antarctica  5. Arctic  7. Atlantic  9. Indian    11. US
  2. America  4. Australia   6. Asia    8. Europe    10. Pacific  12. Etc
Geographic area:
2020-12-14 17:44:11 +01:00
Boris Shtrasman 50cf335a34 Take Marco Trevisan text enhencment 2020-09-17 20:52:37 +03:00
Boris Shtrasman 4e2971be0c enhence text 2020-09-01 16:03:03 +03:00
Boris Shtrasman d9ba514b15 Update documenation (generated man file) to express that plasma notification system will ignore timeout value when level is in critical mode 2020-08-31 21:56:54 +03:00
Marco Trevisan (Treviño) 98a4bf483a release: 0.7.9 2020-02-26 20:06:01 +01:00
Marco Trevisan d30f73d628 Merge branch 'wip/jtojnar/manpage' into 'master'
Add notify-send manpage

Closes #4

See merge request GNOME/libnotify!6
2020-01-13 17:15:51 +00:00
Marco Trevisan ea61ec4301 Merge branch 'snap-paths-support' into 'master'
notification: use snap namespace and prefix whent launched inside snap

See merge request GNOME/libnotify!5
2020-01-13 17:11:47 +00:00
Marco Trevisan b95d41283e Merge branch 'wip/jtojnar/drop-autotools' into 'master'
Drop Autotools

See merge request GNOME/libnotify!11
2020-01-13 17:10:31 +00:00
Jan Tojnar edfd97f4a9
ci: Do not pass default flags to meson 2020-01-13 17:12:00 +01:00
Jan Tojnar a599a04de6
Drop Autotools 2020-01-13 17:09:17 +01:00
Jan Tojnar 162d195869
Add notify-send manpage
Taken from Debian, converted to Docbook and fixed some issues.

Closes: https://gitlab.gnome.org/GNOME/libnotify/issues/4
2020-01-13 16:41:31 +01:00
Iain Lane 2e8ed8add3 notification: Handle snap applications
When a non-relocatable application is packaged as a snap, its resources
will be visible under `${SNAP}`. We can discover these resources by
probing paths that are given to us and trying the same path under
`${SNAP}` if the probe fails.

Snap packages have desktop files namespaced by the snap name. This name
is available inside the snap environment as `${SNAP_NAME}`. Also probe
desktop files and try this form of mangled name if the referenced
desktop file is not found.
2019-08-14 15:43:43 +02:00
Jan Tojnar 55eb69247f
build: check supported linker args before build
MacOS linker does not support --version-script argument so we need
to only add it to ldflags when it is available.
2019-04-26 20:20:22 +02:00
Florian Müllner 44f9222212 Bump version to 0.7.8
Update NEWS.
2019-03-28 19:24:26 +01:00
Florian Müllner f5a845dd00 build: Don't use absolute path with 'subdir' keyword
Newer meson versions expect a relative path (to the includedir option)
there and reject passing an absolute path.

https://gitlab.gnome.org/GNOME/libnotify/merge_requests/8
2019-03-28 19:06:26 +01:00
Iain Lane d3277ac331 Merge branch 'notify-send-support-file-proto' into 'master'
notify-send: allow passing colon as hint value

See merge request GNOME/libnotify!4
2019-02-15 13:35:36 +00: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
Abderrahim Kitouni 3f71a3b3ba meson.build: fix pkg-config generation
The code was previously using glib_dep.version() as a version for gio which
generates an invalid version like "gio-2.0 2.59.1" in the pkg-config file.
2019-02-01 14:21:14 +01:00
Marco Trevisan b7351a39fb Merge branch 'wip/3v1n0/meson' into 'master'
Build with meson and add CI

See merge request GNOME/libnotify!3
2019-01-31 17:15:27 +00:00
Marco Trevisan 593f260722 Build with meson and add CI 2019-01-31 17:15:27 +00:00
Jan Tojnar a1bedfa65e
docs: Fix spec build
Correct DTD and add config.xsl to EXTRA_DIST
2019-01-26 10:44:22 +01: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
Emmanuele Bassi 46e8b1cfad build: Update the list of headers in srcdir
The generated notify-features.h header lives in builddir, which means it
does not exist in srcdir, where glib-mkenums will look. It also contains
pre-processor symbols only, so it's not really useful.

As we removed it from the list of headers to be scanned by the
introspection parser, we also need to update the files rules for that.
2017-07-17 10:11:48 +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
Cosimo Cecchi c954cabaad release: prepare for 0.7.7 2016-10-13 15:44:18 -07:00
Quentin Glidic 6b03c47e04 build: Use ${PKG_CONFIG} instead of pkg-config
Some use cases (e.g. cross-compiling) require a prefixed pkg-config

https://bugzilla.gnome.org/show_bug.cgi?id=758322

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-06-14 16:07:31 +02:00
Quentin Glidic da7a6a229b build: Allow not to build tests
https://bugzilla.gnome.org/show_bug.cgi?id=634790

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-06-14 16:07:31 +02:00