notify-send uses g_strcompress on the body of the notification to
replace escape chars (e.g. newline). Since dunstify is supposed to be a
drop-in replacement we should match that here as well.
If specifying --icon with UTF-8 characters, the g_option_context_parse
fails with an invalid byte conversion. The solution is to set the locale
explicitly.
For more info, see the GLib issue tracker:
https://bugzilla.gnome.org/show_bug.cgi?id=737137Fixes#443
Print the notification id, if requested, before blocking to catch action
return or NotificationClosed signal since once of those events happens
the program will exit without further action, bypassing the id printing
logic.
The notification object should actually get freed by notify_uninit. But
before freeing the notification, notify_uninit also sends the
CloseNotification signal directly, if the timeout is 0.
But the timeout of 0 should actually indicate a notification, which
never expires.
Fixes#415
This mostly means using strchr, but I also found:
option_parser.c:load_ini_file:
- replace multiple calls to strstr with strpbrk
notification.c:notification_init:
- replace string_replace in a while loop with a single call to
string_replace_char
redo string replace all
Add expandtab to vim modelines so that spaces are expanded to tabs, make
life easier for people that have vim configured to use tabs by default.
Expand modeline abbreviations to improve readability.