Skip to content

Commit 7979266

Browse files
committed
Add --category to dunstify
1 parent b7abe8f commit 7979266

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

completions/dunstify.fishcomp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ 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 -l category -d 'The category of this notification'
1920
complete -c dunstify -s c -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'

docs/dunstify.pod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ 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<--category=TYPE>
51+
52+
The category of this notification.
53+
5054
=item B<-c, --capabilities>
5155

5256
Print the server capabilities and exit.

dunstify.c

Lines changed: 6 additions & 1 deletion
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,6 +33,7 @@ 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"},
36+
{ "category", 0, 0, G_OPTION_ARG_STRING, &category, "The category of this notification", "TYPE" },
3537
{ "capabilities", 'c', 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},
@@ -212,7 +214,7 @@ void put_id(NotifyNotification *n, guint32 id)
212214
{
213215
knickers *kn = n->priv;
214216

215-
/* And know I'm putting stuff into
217+
/* And now I'm putting stuff into
216218
* your knickers. I'm sorry.
217219
* I'm so sorry.
218220
* */
@@ -302,6 +304,9 @@ int main(int argc, char *argv[])
302304
notify_notification_set_timeout(n, timeout);
303305
notify_notification_set_urgency(n, urgency);
304306

307+
if (category != NULL)
308+
notify_notification_set_category(n, category);
309+
305310
GError *err = NULL;
306311

307312
if (raw_icon_path) {

0 commit comments

Comments
 (0)