Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
dunstify.c File Reference

Alternative to notify-send tailored for Dunst. More...

#include <glib.h>
#include <libnotify/notify.h>
#include <locale.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+ Include dependency graph for dunstify.c:

Go to the source code of this file.

Functions

void die (int exit_value)
 
void print_capabilities (void)
 
void print_serverinfo (void)
 
void print_version (void)
 
char * get_argv (char *argv[], int index)
 
int count_args (char *argv[], int argc)
 
void parse_commandline (int argc, char *argv[])
 
gint get_id (NotifyNotification *n)
 
void put_id (NotifyNotification *n, guint32 id)
 
void actioned (NotifyNotification *n, char *a, gpointer foo)
 
void closed (NotifyNotification *n, gpointer foo)
 
void add_action (NotifyNotification *n, char *str)
 
void add_hint (NotifyNotification *n, char *str)
 
int main (int argc, char *argv[])
 

Variables

static gchar * appname = "dunstify"
 
static gchar * summary = NULL
 
static gchar * body = NULL
 
static NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL
 
static gchar * urgency_str = NULL
 
static gchar * category = NULL
 
static gchar ** hint_strs = NULL
 
static gchar ** action_strs = NULL
 
static gint timeout = NOTIFY_EXPIRES_DEFAULT
 
static gchar * icon = NULL
 
static gchar * raw_icon_path = NULL
 
static gboolean capabilities = false
 
static gboolean serverinfo = false
 
static gboolean printid = false
 
static guint32 replace_id = 0
 
static guint32 close_id = 0
 
static gboolean wait = false
 
static gchar ** rest = NULL
 
static gboolean transient = false
 
static gboolean say_version = false
 
static GOptionEntry entries []
 

Detailed Description

Alternative to notify-send tailored for Dunst.

License
BSD-3-Clause

Definition in file dunstify.c.

Function Documentation

◆ actioned()

void actioned ( NotifyNotification * n,
char * a,
gpointer foo )

Definition at line 226 of file dunstify.c.

◆ add_action()

void add_action ( NotifyNotification * n,
char * str )

Definition at line 239 of file dunstify.c.

◆ add_hint()

void add_hint ( NotifyNotification * n,
char * str )

Definition at line 255 of file dunstify.c.

◆ closed()

void closed ( NotifyNotification * n,
gpointer foo )

Definition at line 233 of file dunstify.c.

◆ count_args()

int count_args ( char * argv[],
int argc )

Definition at line 128 of file dunstify.c.

◆ die()

void die ( int exit_value)

Definition at line 70 of file dunstify.c.

◆ get_argv()

char * get_argv ( char * argv[],
int index )

Definition at line 117 of file dunstify.c.

◆ get_id()

gint get_id ( NotifyNotification * n)

Definition at line 214 of file dunstify.c.

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 289 of file dunstify.c.

◆ parse_commandline()

void parse_commandline ( int argc,
char * argv[] )

Definition at line 137 of file dunstify.c.

◆ print_capabilities()

void print_capabilities ( void )

Definition at line 77 of file dunstify.c.

◆ print_serverinfo()

void print_serverinfo ( void )

Definition at line 87 of file dunstify.c.

◆ print_version()

void print_version ( void )

Definition at line 105 of file dunstify.c.

◆ put_id()

void put_id ( NotifyNotification * n,
guint32 id )

Definition at line 221 of file dunstify.c.

Variable Documentation

◆ action_strs

gchar** action_strs = NULL
static

Definition at line 25 of file dunstify.c.

◆ appname

gchar* appname = "dunstify"
static

Definition at line 18 of file dunstify.c.

◆ body

gchar* body = NULL
static

Definition at line 20 of file dunstify.c.

◆ capabilities

gboolean capabilities = false
static

Definition at line 29 of file dunstify.c.

◆ category

gchar* category = NULL
static

Definition at line 23 of file dunstify.c.

◆ close_id

guint32 close_id = 0
static

Definition at line 33 of file dunstify.c.

◆ entries

GOptionEntry entries[]
static
Initial value:
=
{
{ "urgency", 'u', 0, G_OPTION_ARG_STRING, &urgency_str, "The urgency of this notification", "URG" },
{ "expire-time", 't', 0, G_OPTION_ARG_INT, &timeout, "The time in milliseconds until the notification expires", "TIMEOUT" },
{ "app-name", 'a', 0, G_OPTION_ARG_STRING, &appname, "Name of your application", "NAME" },
{ "icon", 'i', 0, G_OPTION_ARG_STRING, &icon, "An icon that should be displayed with the notification", "ICON" },
{ "raw-icon", 'I', 0, G_OPTION_ARG_STRING, &raw_icon_path, "Path to the icon to be sent as raw image data", "RAW_ICON"},
{ "category", 'c', 0, G_OPTION_ARG_STRING, &category, "The category of this notification", "TYPE" },
{ "transient", 'e', 0, G_OPTION_ARG_INT, &transient, "Mark the notification as transient", NULL },
{ "hint", 'h', 0, G_OPTION_ARG_STRING_ARRAY, &hint_strs, "User specified hints", "TYPE:NAME:VALUE" },
{ "print-id", 'p', 0, G_OPTION_ARG_NONE, &printid, "Print id, which can be used to update/replace this notification", NULL },
{ "replace-id", 'r', 0, G_OPTION_ARG_INT, &replace_id, "Set id of this notification", "ID" },
{ "wait", 'w', 0, G_OPTION_ARG_NONE, &wait, "Block until notification is closed and print close reason", NULL },
{ "action", 'A', 0, G_OPTION_ARG_STRING_ARRAY, &action_strs, "Actions the user can invoke", "ACTION" },
{ "close", 'C', 0, G_OPTION_ARG_INT, &close_id, "Close the notification with the specified ID", "ID" },
{ "hints", 0, 0, G_OPTION_ARG_STRING_ARRAY, &hint_strs, "Legacy alias of '--hint'", "HINT" },
{ "timeout", 0, 0, G_OPTION_ARG_INT, &timeout, "Legacy alias of '--expire-time'", "TIMEOUT" },
{ "printid", 0, 0, G_OPTION_ARG_NONE, &printid, "Legacy alias of '--print-id'", NULL },
{ "replace", 0, 0, G_OPTION_ARG_INT, &replace_id, "Legacy alias of '--replace-id'", "ID" },
{ "block", 'b', 0, G_OPTION_ARG_NONE, &wait, "Legacy alias of '--wait'", NULL },
{ "raw_icon", 0, 0, G_OPTION_ARG_STRING, &raw_icon_path, "Legacy alias of '--raw-icon'", NULL },
{ "capabilities", 0, 0, G_OPTION_ARG_NONE, &capabilities, "Print the server capabilities and exit", NULL },
{ "serverinfo", 0, 0, G_OPTION_ARG_NONE, &serverinfo, "Print server information and exit", NULL },
{ "version", 'v', 0, G_OPTION_ARG_NONE, &say_version, "Print version information and exit", NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &rest, NULL, NULL },
{ NULL }
}

Definition at line 39 of file dunstify.c.

◆ hint_strs

gchar** hint_strs = NULL
static

Definition at line 24 of file dunstify.c.

◆ icon

gchar* icon = NULL
static

Definition at line 27 of file dunstify.c.

◆ printid

gboolean printid = false
static

Definition at line 31 of file dunstify.c.

◆ raw_icon_path

gchar* raw_icon_path = NULL
static

Definition at line 28 of file dunstify.c.

◆ replace_id

guint32 replace_id = 0
static

Definition at line 32 of file dunstify.c.

◆ rest

gchar** rest = NULL
static

Definition at line 35 of file dunstify.c.

◆ say_version

gboolean say_version = false
static

Definition at line 37 of file dunstify.c.

◆ serverinfo

gboolean serverinfo = false
static

Definition at line 30 of file dunstify.c.

◆ summary

gchar* summary = NULL
static

Definition at line 19 of file dunstify.c.

◆ timeout

gint timeout = NOTIFY_EXPIRES_DEFAULT
static

Definition at line 26 of file dunstify.c.

◆ transient

gboolean transient = false
static

Definition at line 36 of file dunstify.c.

◆ urgency

NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL
static

Definition at line 21 of file dunstify.c.

◆ urgency_str

gchar* urgency_str = NULL
static

Definition at line 22 of file dunstify.c.

◆ wait

gboolean wait = false
static

Definition at line 34 of file dunstify.c.