Skip to content

Commit 884fad3

Browse files
authored
Merge branch 'master' into more-signal
2 parents aabd978 + 73c7f92 commit 884fad3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+551
-347
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- gcc
2626
distro:
2727
- alpine
28+
- alpine-edge
2829
- archlinux
2930
- debian-bookworm
3031
- debian-bullseye

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*.swp
12
*.o
23
*.d
34
*.gcda

CHANGELOG.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Dunst changelog
22

3+
## 1.12.1 -- 2024-12-17
4+
5+
### Changed
6+
- Improve man pages and add `dunstify(1)`
7+
- Accept old `height` syntax again (with notice) (#1412)
8+
- Add `history-clear` and `history-rm` zsh completions (#1418)
9+
10+
### Fixed
11+
- Memory corruption when reloading (#1413)
12+
- Fix height calculation regression (#1411)
13+
- Handle correctly file uri icons (#1409)
14+
- Fix typos in docs (#1415)
15+
316
## 1.12.0 -- 2024-11-30
417

518
### Added
@@ -189,13 +202,10 @@
189202
- Not being able to override anymore raw icons with `new_icon` (#1009)
190203
- High cpu usage when selecting an action in dmenu or similar. This was caused
191204
by dunst not going to sleep when waiting for a response. (#898)
192-
- Updated default values documentation (with help from @profpatch) (#1004 and
193-
more)
194-
205+
- Updated default values documentation (with help from @profpatch) (#1004 and more)
195206

196207
## 1.7.3 -- 2021-12-08
197208

198-
### Added
199209
### Changed
200210
- `follow` is now `none` again by default. This was the case before v1.7.0 as well. (#990).
201211

@@ -219,7 +229,7 @@
219229
ID to `dunstctl history-pop`. (#970)
220230
- `default_icon` setting for setting the icon when no icons are given (#984)
221231
- Implemented display size detection in Wayland. (#973)
222-
### Changed
232+
223233
### Fixed
224234
- Text being cut off on X11 when using fractional scaling. (#975)
225235
- Incorrect hitbox for notification on X11 with scaling. (#980)
@@ -309,12 +319,12 @@
309319
- Setting settings via command line arguments. (#803)
310320
- Setting settings via `config.h`. (#803)
311321

312-
## 1.6.1 - 2021-02-21:
322+
## 1.6.1 -- 2021-02-21:
313323

314324
### Fixed
315325
- Incorrect version in Makefile
316326

317-
## 1.6.0 - 2021-02-21:
327+
## 1.6.0 -- 2021-02-21:
318328

319329
### Added
320330
- Wayland support. Dunst now runs natively on wayland. This fixes several bugs
@@ -339,11 +349,11 @@
339349
- `dunstify` can pass empty appname to libnotify (#768)
340350
- Incorrect handling of 'do_action, close' mouse action (#778)
341351

342-
# Removed
352+
### Removed
343353

344354
- `DUNST_COMMAND_{PAUSE,RESUME,TOGGLE}` (#830)
345355

346-
## 1.5.0 - 2020-07-23
356+
## 1.5.0 -- 2020-07-23
347357

348358
### Added
349359
- `min_icon_size` option to automatically scale up icons to a desired value (#674)
@@ -364,7 +374,7 @@
364374
- Crash when `$HOME` environment variable is unset (#693)
365375
- Lack of antialiasing with round corners enabled (#713)
366376

367-
## 1.4.1 - 2019-07-03
377+
## 1.4.1 -- 2019-07-03
368378

369379
### Fixed
370380

@@ -375,7 +385,7 @@
375385
- Crash when changing DPI while no notifications are displayed (#630)
376386
- Fullscreen status change not being detected in some cases (#613)
377387

378-
## 1.4.0 - 2019-03-30
388+
## 1.4.0 -- 2019-03-30
379389

380390
### Added
381391

@@ -415,19 +425,19 @@
415425

416426
- Dependency on libxdg-basedir (#550)
417427

418-
## 1.3.2 - 2018-05-06
428+
## 1.3.2 -- 2018-05-06
419429

420430
### Fixed
421431

422432
- Crash when trying to load an invalid or corrupt icon (#512)
423433

424-
## 1.3.1 - 2018-01-30
434+
## 1.3.1 -- 2018-01-30
425435

426436
### Fixed
427437

428438
- Race condition resulting in the service files being empty (#488)
429439

430-
## 1.3.0 - 2018-01-05
440+
## 1.3.0 -- 2018-01-05
431441

432442
### Added
433443
- `ellipsize` option to control how long lines should be ellipsized when `word_wrap` is set to `false` (#374)
@@ -463,7 +473,7 @@
463473
- Dunst does now install the systemd and dbus service files into their proper location given
464474
by pkg-config. Use `SERVICEDIR_(DBUS|SYSTEMD)` params to overwrite them. (#463)
465475

466-
## 1.2.0 - 2017-07-12
476+
## 1.2.0 -- 2017-07-12
467477

468478
### Added
469479
- `always_run_script` option to run script even if a notification is suppressed
@@ -505,19 +515,19 @@
505515
- dmenu process being left as a zombie if no option was selected
506516
- Crash when opening urls parsed from `<a href="">` tags
507517

508-
## 1.1.0 - 2014-07-29
518+
## 1.1.0 -- 2014-07-29
509519
- fix nasty memory leak
510520
- icon support (still work in progress)
511521
- fix issue where keybindings aren't working when numlock is activated
512522

513-
## 1.0.0 - 2013-04-15
523+
## 1.0.0 -- 2013-04-15
514524
- use pango/cairo as drawing backend
515525
- make use of pangos ability to parse markup
516526
- support for actions via context menu
517527
- indicator for actions/urls found
518528
- use blocking I/O. No more waking up the CPU multiple times per second to check for new dbus messages
519529

520-
## 0.5.0 - 2013-01-26
530+
## 0.5.0 -- 2013-01-26
521531
- new default dunstrc
522532
- frames for window
523533
- trigger scripts on matching notifications
@@ -526,7 +536,7 @@
526536
- use own code for ini parsing (this removes inih)
527537
- progress hints
528538

529-
## 0.4.0 - 2012-09-27
539+
## 0.4.0 -- 2012-09-27
530540
- separator between notifications
531541
- word wrap long lines
532542
- real transparance
@@ -537,10 +547,10 @@
537547
- bugfix: forgetting geometry
538548
- (optional) static configuration
539549

540-
## 0.3.1 - 2012-08-02
550+
## 0.3.1 -- 2012-08-02
541551
- fix -mon option
542552

543-
## 0.3.0 - 2012-07-30
553+
## 0.3.0 -- 2012-07-30
544554
- full support for Desktop Notification Specification (mandatory parts)
545555
- option to select monitor on which notifications are shown
546556
- follow focus
@@ -554,7 +564,7 @@
554564
- cleanup / bugfixes etc.
555565
- added dunst.service
556566

557-
## 0.2.0 - 2012-06-26
567+
## 0.2.0 -- 2012-06-26
558568
- introduction of dunstrc
559569
- removed static configuration via config.h
560570
- don't timeout when user is idle

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
include config.mk
55

6-
VERSION := "1.12.0-non-git"
6+
VERSION := "1.12.1-non-git"
77
ifneq ($(wildcard ./.git/),)
88
VERSION := $(shell ${GIT} describe --tags 2>/dev/null || echo ${VERSION})
99
endif
@@ -74,9 +74,15 @@ debug: all
7474

7575
${OBJ} ${TEST_OBJ}: Makefile config.mk
7676

77+
DATE_FMT = +%Y-%m-%d
78+
ifdef SOURCE_DATE_EPOCH
79+
BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
80+
else
81+
BUILD_DATE ?= $(shell date "$(DATE_FMT)")
82+
endif
7783
src/dunst.o: src/dunst.c
7884
${CC} -o $@ -c $< ${CPPFLAGS} ${CFLAGS} \
79-
-D_CCDATE="$(shell date '+%Y-%m-%d')" -D_CFLAGS="$(filter-out $(filter -I%,${INCS}),${CFLAGS})" -D_LDFLAGS="${LDFLAGS}"
85+
-D_CCDATE="${BUILD_DATE}" -D_CFLAGS="$(filter-out $(filter -I%,${INCS}),${CFLAGS})" -D_LDFLAGS="${LDFLAGS}"
8086

8187
%.o: %.c
8288
${CC} -o $@ -c $< ${CPPFLAGS} ${CFLAGS}

RELEASE_NOTES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ PACKAGE MAINTAINERS:
420420
or close existing notifications.
421421

422422
example:
423-
id=$(dunstify -p "Replace" "this should get replaced after the sleep")
423+
id=$(dunstify -p "Replace" "this should get replaced after the sleep")
424424
sleep 5
425425
dunstify -r $id "replacement"
426426

completions/_dunstctl.zshcomp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ case $state in
2222
'context:Open context menu'
2323
'count:Show the number of notifications'
2424
'history:Display notification history (in JSON)'
25+
'history-clear:Delete all notifications from history'
2526
'history-pop:Pop the latest notification from history or optionally the notification with given ID'
27+
'history-remove:Remove the notification from'
2628
'is-paused:Check if pause level is greater than 0'
2729
'set-paused:Set the pause status'
2830
'get-pause-level:Get the current pause level'

completions/dunstify.fishcomp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ complete -c dunstify -s A -l action -x -d 'Actions the user can invoke'
1616
complete -c dunstify -s t -l timeout -x -d 'The time in milliseconds until the notification expires'
1717
complete -c dunstify -s i -l icon -x -d 'An Icon that should be displayed with the notification'
1818
complete -c dunstify -s I -l raw_icon -r -d 'Path to the icon to be sent as raw image data'
19-
complete -c dunstify -s c -l capabilities -d 'Print the server capabilities and exit'
19+
complete -c dunstify -s c -l category -d 'The category of this notification'
20+
complete -c dunstify -l capabilities -d 'Print the server capabilities and exit'
2021
complete -c dunstify -s s -l serverinfo -d 'Print server information and exit'
2122
complete -c dunstify -s p -l printid -d 'Print id, which can be used to update/replace this notification'
2223
complete -c dunstify -s r -l replace -x -a '(__fish_dunstify_history)' -d 'Set id of this notification.'

docs/dunst.5.pod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ replace icon_path search.
474474

475475
=item B<icon_theme> (default: "Adwaita", example: "Adwaita, breeze")
476476

477-
Comma-separated list of names of the the themes to use for looking up icons. This
478-
as to be the name of the directory in which the theme is located, not the
477+
Comma-separated list of names of the themes to use for looking up icons. This
478+
has to be the name of the directory in which the theme is located, not the
479479
human-friendly name of the theme. So for example, the theme B<Breeze Dark> is
480480
located in F</usr/share/icons/breeze-dark>. In this case you have to set the
481481
theme to B<breeze-dark>.

docs/dunstify.pod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ Specifies an icon to display with the notification.
4747

4848
Path to the icon to be sent as raw image data.
4949

50-
=item B<-c, --capabilities>
50+
=item B<-c, --category=TYPE>
51+
52+
The category of this notification.
53+
54+
=item B<--capabilities>
5155

5256
Print the server capabilities and exit.
5357

dunstify.c

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ static gchar *summary = NULL;
1111
static gchar *body = NULL;
1212
static NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
1313
static gchar *urgency_str = NULL;
14+
static gchar *category = NULL;
1415
static gchar **hint_strs = NULL;
1516
static gchar **action_strs = NULL;
1617
static gint timeout = NOTIFY_EXPIRES_DEFAULT;
@@ -32,7 +33,8 @@ static GOptionEntry entries[] =
3233
{ "timeout", 't', 0, G_OPTION_ARG_INT, &timeout, "The time in milliseconds until the notification expires", "TIMEOUT" },
3334
{ "icon", 'i', 0, G_OPTION_ARG_STRING, &icon, "An icon that should be displayed with the notification", "ICON" },
3435
{ "raw_icon", 'I', 0, G_OPTION_ARG_STRING, &raw_icon_path, "Path to the icon to be sent as raw image data", "RAW_ICON"},
35-
{ "capabilities", 'c', 0, G_OPTION_ARG_NONE, &capabilities, "Print the server capabilities and exit", NULL},
36+
{ "category", 'c', 0, G_OPTION_ARG_STRING, &category, "The category of this notification", "TYPE" },
37+
{ "capabilities", 0, 0, G_OPTION_ARG_NONE, &capabilities, "Print the server capabilities and exit", NULL},
3638
{ "serverinfo", 's', 0, G_OPTION_ARG_NONE, &serverinfo, "Print server information and exit", NULL},
3739
{ "printid", 'p', 0, G_OPTION_ARG_NONE, &printid, "Print id, which can be used to update/replace this notification", NULL},
3840
{ "replace", 'r', 0, G_OPTION_ARG_INT, &replace_id, "Set id of this notification.", "ID"},
@@ -171,53 +173,20 @@ void parse_commandline(int argc, char *argv[])
171173
}
172174
}
173175

174-
typedef struct _NotifyNotificationPrivate
175-
{
176-
guint32 id;
177-
char *app_name;
178-
char *summary;
179-
char *body;
180-
181-
/* NULL to use icon data. Anything else to have server lookup icon */
182-
char *icon_name;
183-
184-
/*
185-
* -1 = use server default
186-
* 0 = never timeout
187-
* > 0 = Number of milliseconds before we timeout
188-
*/
189-
gint timeout;
190-
191-
GSList *actions;
192-
GHashTable *action_map;
193-
GHashTable *hints;
194-
195-
gboolean has_nondefault_actions;
196-
gboolean updates_pending;
197-
198-
gulong proxy_signal_handler;
199-
200-
gint closed_reason;
201-
} knickers;
202-
203176
int get_id(NotifyNotification *n)
204177
{
205-
knickers *kn = n->priv;
206-
207-
/* I'm sorry for taking a peek */
208-
return kn->id;
178+
GValue value = G_VALUE_INIT;
179+
g_value_init(&value, G_TYPE_UINT);
180+
g_object_get_property(G_OBJECT(n), "id", &value);
181+
return g_value_get_int(&value);
209182
}
210183

211184
void put_id(NotifyNotification *n, guint32 id)
212185
{
213-
knickers *kn = n->priv;
214-
215-
/* And know I'm putting stuff into
216-
* your knickers. I'm sorry.
217-
* I'm so sorry.
218-
* */
219-
220-
kn->id = id;
186+
GValue value = G_VALUE_INIT;
187+
g_value_init(&value, G_TYPE_UINT);
188+
g_value_set_uint(&value, id);
189+
g_object_set_property(G_OBJECT(n), "id", &value);
221190
}
222191

223192
void actioned(NotifyNotification *n, char *a, gpointer foo)
@@ -302,6 +271,9 @@ int main(int argc, char *argv[])
302271
notify_notification_set_timeout(n, timeout);
303272
notify_notification_set_urgency(n, urgency);
304273

274+
if (category != NULL)
275+
notify_notification_set_category(n, category);
276+
305277
GError *err = NULL;
306278

307279
if (raw_icon_path) {

0 commit comments

Comments
 (0)