Browse Source

lazy update

John ShaggyTwoDope Jenkins 4 years ago
parent
commit
944838f866
7 changed files with 579 additions and 3 deletions
  1. 157
    0
      adressimport
  2. 3
    3
      backup
  3. 16
    0
      rubyimg.rb
  4. 89
    0
      src/dunstify/Makefile
  5. 0
    0
      src/dunstify/config.mk
  6. BIN
      src/dunstify/dunstify
  7. 314
    0
      src/dunstify/dunstify.c

+ 157
- 0
adressimport View File

@@ -0,0 +1,157 @@
1
+#!/usr/bin/python
2
+# adr_conv.py
3
+#
4
+# Converts a vCard address book into abook addressbook format
5
+#
6
+# Author:   Gavin Costello (gavcos@gmail.com)
7
+# Date:     19.02.2009
8
+
9
+import optparse
10
+
11
+desc="""This program converts a gmail vCard address book into a format readable by abook
12
+(http://abook.sourceforge.net).
13
+
14
+To export your gmail contacts in vCard format, select Contacts -> Export and choose the 3rd export format (vCard).
15
+
16
+The file will be saved by default as contacts.vcf
17
+
18
+"""
19
+
20
+parser = optparse.OptionParser(description=desc, version='%prog version 1.0')
21
+
22
+parser.add_option('-i', '--inputfile', \
23
+        dest='inputfile', action='store', default='contacts.vcf', \
24
+        help='The name of the vCard file containing the contacts to convert (default=%default)')
25
+parser.add_option('-o', '--outputfile', \
26
+        dest='outputfile', action='store', default='addressbook', \
27
+        help='The name of the output file to be generated by this script (default=%default)')
28
+parser.add_option('-d', '--debug', \
29
+        dest='debug', action='store_true', default=False,
30
+        help='Print debug statements (default=%default)')
31
+
32
+(opts, args) = parser.parse_args()
33
+
34
+name = '';  # Contact name
35
+phone = ''; # Contact phone
36
+email = ''; # Contact email
37
+nick = '';  # Contact nickname
38
+org = '';   # Contact organisation
39
+note = '';  # Notes
40
+emails = [] # Email list
41
+count = 0; # Contacts count
42
+
43
+# Open input file, read-only
44
+try:
45
+    cfile = open(opts.inputfile, 'r')
46
+except IOError:
47
+    print('Unable to open input file: %s' % opts.inputfile)
48
+    raise
49
+
50
+# Open output file for writing
51
+try:
52
+    ofile = open(opts.outputfile, 'w+')
53
+except IOError:
54
+    print('Unable to open output file: %s' % opts.outputfile)
55
+    raise
56
+
57
+ofile.write('\n')
58
+ofile.write('[format]\n')
59
+ofile.write('program=abook\n')
60
+ofile.write('\n')
61
+
62
+# Loop through input file
63
+for line in cfile.readlines():
64
+    # Name field
65
+    if (line.startswith('FN')):
66
+        name = line.split(':')[1].strip()
67
+        #name = unicode(name, 'utf-8')
68
+        ofile.write('\n')
69
+        ofile.write('[%d]\n' % count)
70
+        count += 1
71
+        if opts.debug:
72
+            print(name, end="")
73
+        ofile.write('name=%s\n' % name)
74
+    elif (line.startswith('EMAIL')):
75
+        email = line.split(':')[1].strip()
76
+        emails.append(email)
77
+    elif (line.startswith('TEL')):
78
+        # Verify if it's a fax number
79
+        parts = line.split(';')
80
+        if (len(parts) > 2): # Fax number
81
+            phone = parts[2].split(':')[1]
82
+            ofile.write('fax=%s' % phone)
83
+            continue
84
+
85
+        # Normal telephone number
86
+        try:
87
+            tel = parts[1]
88
+        except IndexError: # Phone type not defined (other in gmail)
89
+            phone = line.split(':')[1]
90
+            ofile.write('mobile=%s' % phone)
91
+            continue
92
+
93
+        fulltype = tel.split('=')[1]
94
+        type = fulltype.split(':')[0]
95
+        if opts.debug:
96
+            print('type=%s' % type,)
97
+
98
+        phone = line.split(':')[1]
99
+        if (type == 'HOME'):
100
+            ofile.write('phone=%s' % phone)
101
+        if (type == 'CELL'):
102
+            ofile.write('mobile=%s' % phone)
103
+        if (type == 'WORK'):
104
+            ofile.write('workphone=%s' % phone)
105
+    elif (line.startswith('NICKNAME')):
106
+        # Notes / nicknames
107
+        try:
108
+            nick = line.split(':')[2].strip()
109
+        except IndexError:
110
+            nick = line.split(':')[1].strip()
111
+        ofile.write('nick=%s\n' % nick,)
112
+    elif (line.startswith('ORG')):
113
+        org = line.split(':')[1].strip()
114
+        if ((name == "") & (org != "")):
115
+            ofile.write('name=%s' % org,)
116
+            ofile.write('custom1=%s' % org,)
117
+    elif (line.startswith('NOTE')):
118
+        note = line.split(':')[1].strip()
119
+        ofile.write('note=%s\n' % note,)
120
+    elif (line.startswith('ADR')):
121
+        # Address
122
+        adr_parts = line.split(';')[2:]
123
+        for i, part in enumerate(adr_parts):
124
+            if (part):
125
+                if i == 0:
126
+                    ofile.write('address_lines=%s\n' % part)
127
+                if i == 1:
128
+                    ofile.write('address_lines=%s\n' % part)
129
+                if i == 2:
130
+                    ofile.write('city=%s\n' % part)
131
+                if i == 3:
132
+                    ofile.write('state=%s\n' % part)
133
+                if i == 4:
134
+                    ofile.write('zip=%s\n' % part)
135
+                if i == 5:
136
+                    ofile.write('country=%s\n' % part)
137
+    elif (line.startswith('END')):
138
+        if (len(emails) > 0):
139
+            ofile.write('email=%s\n' % ", ".join(emails),)
140
+            emails = []
141
+    else:
142
+        continue;
143
+
144
+print('\n%s contacts processed' % count)
145
+
146
+try:
147
+    cfile.close()
148
+except IOError:
149
+    print('Unable to close input file: %s' % opts.inputfile)
150
+    raise
151
+try:
152
+    ofile.close()
153
+except IOError:
154
+    print('Unable to close output file: %s' % opts.outputfile)
155
+    raise
156
+
157
+exit(0)

+ 3
- 3
backup View File

@@ -10,11 +10,11 @@ INCLUDE1="/home/shaggy/.vimrc /home/shaggy/.abook /home/shaggy/.calcurse /home/s
10 10
 INCLUDE2="/home/shaggy/.config/bspwm /home/shaggy/.config/dwb /home/shaggy/.config/htop /home/shaggy/.config/mpd"
11 11
 INCLUDE3="/home/shaggy/.config/mps-youtube /home/shaggy/.config/mpv /home/shaggy/.config/Mumble /home/shaggy/.config/qutebrowser"
12 12
 INCLUDE4="/home/shaggy/.config/ranger /home/shaggy/.config/sxhkd /home/shaggy/.config/sxiv /home/shaggy/.config/wmfs"
13
-INCLUDE5="/home/shaggy/.config/youtube-viewer /home/shaggy/.cortex /home/shaggy/.fonts /home/shaggy/.fluxbox"
13
+INCLUDE5="/home/shaggy/.config/youtube-viewer /home/shaggy/.cortex /home/shaggy/.fluxbox"
14 14
 INCLUDE6="/home/shaggy/.irssi /home/shaggy/.i3 /home/shaggy/.mpv /home/shaggy/.mutt /home/shaggy/.muttrc"
15 15
 INCLUDE7="/home/shaggy/.nano /home/shaggy/.ncmpcpp /home/shaggy/.newsbeuter /home/shaggy/.offlineimap"
16
-INCLUDE8="/home/shaggy/.ssh /home/shaggy/.themes /home/shaggy/.turses /home/shaggy/.password-store"
17
-INCLUDE9="/home/shaggy/.vim /home/shaggy/.weechat /home/shaggy/scripts /home/shaggy/.aliasrc"
16
+INCLUDE8="/home/shaggy/.ssh /home/shaggy/.turses /home/shaggy/.password-store"
17
+INCLUDE9="/home/shaggy/.weechat /home/shaggy/scripts /home/shaggy/.aliasrc"
18 18
 INCLUDE10="/home/shaggy/.cliweather /home/shaggy/.conkyrc /home/shaggy/.gitconfig /home/shaggy/.goobook_cache"
19 19
 INCLUDE11="/home/shaggy/.msmtprc /home/shaggy/.nanorc /home/shaggy/.netrc /home/shaggy/.offlineimaprc"
20 20
 INCLUDE12="/home/shaggy/.notmuch-config /home/shaggy/.Xdefaults /home/shaggy/.xinitrc /home/shaggy/.xprofile"

+ 16
- 0
rubyimg.rb View File

@@ -0,0 +1,16 @@
1
+#!/usr/bin/env ruby
2
+# Text File
3
+# AUTHOR:   shaggy
4
+# FILE:     rubyimg.rb
5
+# ROLE:     TODO (some explanation)
6
+# CREATED:  2015-06-29 19:35:05
7
+# MODIFIED: 2015-06-29 19:35:09
8
+require "tco"
9
+require "rmagick"
10
+
11
+img = Magick::Image::read(ARGV[0]).first
12
+img.each_pixel do |pixel, col, row|
13
+  c = [pixel.red, pixel.green, pixel.blue].map { |v| 256 * (v / 65535.0) }
14
+  pixel.opacity == 65535 ? print("  ") : print("  ".bg c)
15
+  puts if col >= img.columns - 1
16
+end

+ 89
- 0
src/dunstify/Makefile View File

@@ -0,0 +1,89 @@
1
+# dunst - Notification-daemon
2
+# See LICENSE file for copyright and license details.
3
+
4
+include config.mk
5
+
6
+SRC = x.c  \
7
+	  dunst.c \
8
+	  dbus.c  \
9
+	  utils.c \
10
+	  option_parser.c \
11
+	  settings.c \
12
+	  rules.c \
13
+	  menu.c \
14
+	  notification.c
15
+OBJ = ${SRC:.c=.o}
16
+
17
+V ?= 0
18
+ifeq (${V}, 0)
19
+.SILENT:
20
+endif
21
+
22
+all: doc options dunst service
23
+
24
+options:
25
+	@echo dunst build options:
26
+	@echo "CFLAGS   = ${CFLAGS}"
27
+	@echo "LDFLAGS  = ${LDFLAGS}"
28
+	@echo "CC       = ${CC}"
29
+
30
+.c.o:
31
+	@echo CC -c $<
32
+	${CC} -c $< ${CFLAGS}
33
+
34
+${OBJ}: config.h config.mk
35
+
36
+config.h: config.def.h
37
+	@if test -s $@; then echo $< is newer than $@, merge and save $@. If you haven\'t edited $@ you can just delete it	&& exit 1; fi
38
+	@echo creating $@ from $<
39
+	@cp $< $@
40
+
41
+dunst: ${OBJ}
42
+	@echo "${CC} ${CFLAGS} -o $@ ${OBJ} ${LDFLAGS}"
43
+	@${CC} ${CFLAGS} -o $@ ${OBJ} ${LDFLAGS}
44
+
45
+dunstify:
46
+	@${CC} -o $@ dunstify.c -std=c99 $(shell pkg-config --libs --cflags glib-2.0 libnotify)
47
+
48
+debug: ${OBJ}
49
+	@echo CC -o $@
50
+	@${CC} ${CFLAGS} -O0 -o dunst ${OBJ} ${LDFLAGS}
51
+
52
+clean:
53
+	@echo cleaning
54
+	rm -f ${OBJ}
55
+	rm -f dunst
56
+	rm -f dunst.1
57
+	rm -f org.knopwob.dunst.service
58
+	rm -f core
59
+	rm -f dunstify
60
+
61
+doc: dunst.1
62
+dunst.1: README.pod
63
+	pod2man --name=dunst -c "Dunst Reference" --section=1 --release=${VERSION} $< > $@
64
+
65
+service:
66
+	@sed "s|##PREFIX##|$(PREFIX)|" org.knopwob.dunst.service.in > org.knopwob.dunst.service
67
+
68
+install: all
69
+	@echo installing executables to ${DESTDIR}${PREFIX}/bin
70
+	mkdir -p ${DESTDIR}${PREFIX}/bin
71
+	cp -f dunst ${DESTDIR}${PREFIX}/bin
72
+	chmod 755 ${DESTDIR}${PREFIX}/bin/dunst
73
+	@echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
74
+	mkdir -p ${DESTDIR}${MANPREFIX}/man1
75
+	cp -f dunst.1 ${DESTDIR}${MANPREFIX}/man1/
76
+	chmod 644 ${DESTDIR}${MANPREFIX}/man1/dunst.1
77
+	mkdir -p "${DESTDIR}${PREFIX}/share/dunst"
78
+	 cp -f dunstrc ${DESTDIR}${PREFIX}/share/dunst
79
+	mkdir -p "${DESTDIR}${PREFIX}/share/dbus-1/services/"
80
+	cp -vf org.knopwob.dunst.service "${DESTDIR}${PREFIX}/share/dbus-1/services/org.knopwob.dunst.service"
81
+
82
+uninstall:
83
+	@echo removing executables from ${DESTDIR}${PREFIX}/bin
84
+	rm -f ${DESTDIR}${PREFIX}/bin/dunst
85
+	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
86
+	rm -f ${DESTDIR}${MANPREFIX}/man1/dunst
87
+	rm -f ${DESTDIR}${PREFIX}/share/dbus-1/service/org.knopwob.dunst.service
88
+
89
+.PHONY: all options clean dist install uninstall

+ 0
- 0
src/dunstify/config.mk View File


BIN
src/dunstify/dunstify View File


+ 314
- 0
src/dunstify/dunstify.c View File

@@ -0,0 +1,314 @@
1
+#include <glib.h>
2
+#include <libnotify/notify.h>
3
+#include <stdbool.h>
4
+#include <stdlib.h>
5
+#include <string.h>
6
+
7
+static gchar *appname = "dunstify";
8
+static gchar *summary = NULL;
9
+static gchar *body = NULL;
10
+static NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
11
+static gchar *urgency_str = NULL;
12
+static gchar **hint_strs = NULL;
13
+static gchar **action_strs = NULL;
14
+static gint timeout = NOTIFY_EXPIRES_DEFAULT;
15
+static gchar *icon = NULL;
16
+static gboolean capabilities = false;
17
+static gboolean serverinfo = false;
18
+static gboolean printid = false;
19
+static guint32 replace_id = 0;
20
+static guint32 close_id = 0;
21
+static gboolean block = false;
22
+
23
+static GOptionEntry entries[] =
24
+{
25
+    { "appname", 'a', 0, G_OPTION_ARG_STRING, &appname, "Name of your application", "NAME" },
26
+    { "urgency", 'u', 0, G_OPTION_ARG_STRING, &urgency_str, "The urgency of this notification", "URG" },
27
+    { "hints",   'h', 0, G_OPTION_ARG_STRING_ARRAY, &hint_strs, "User specified hints", "HINT" },
28
+    { "action", 'A', 0, G_OPTION_ARG_STRING_ARRAY, &action_strs, "Actions the user can invoke", "ACTION" },
29
+    { "timeout", 't', 0, G_OPTION_ARG_INT, &timeout, "The time until the notification expires", "TIMEOUT" },
30
+    { "icon",    'i', 0, G_OPTION_ARG_STRING, &icon, "An Icon that should be displayed with the notification", "ICON" },
31
+    { "capabilities",   'c', 0, G_OPTION_ARG_NONE, &capabilities, "Print the server capabilities and exit", NULL},
32
+    { "serverinfo", 's', 0, G_OPTION_ARG_NONE, &serverinfo, "Print server information and exit", NULL},
33
+    { "printid", 'p', 0, G_OPTION_ARG_NONE, &printid, "Print id, which can be used to update/replace this notification", NULL},
34
+    { "replace", 'r', 0, G_OPTION_ARG_INT, &replace_id, "Set id of this notification.", "ID"},
35
+    { "close", 'C', 0, G_OPTION_ARG_INT, &close_id, "Set id of this notification.", "ID"},
36
+    { "block", 'b', 0, G_OPTION_ARG_NONE, &block, "Block until notification is closed and print close reason", NULL},
37
+    { NULL }
38
+};
39
+
40
+void die(int exit_value)
41
+{
42
+    if (notify_is_initted())
43
+        notify_uninit();
44
+    exit(exit_value);
45
+}
46
+
47
+void print_capabilities(void)
48
+{
49
+    GList *caps = notify_get_server_caps();
50
+    for (GList *iter = caps; iter; iter = iter->next) {
51
+        if (strlen(iter->data) > 0) {
52
+            g_print("%s\n", iter->data);
53
+        }
54
+    }
55
+}
56
+
57
+void print_serverinfo(void)
58
+{
59
+    char *name;
60
+    char *vendor;
61
+    char *version;
62
+    char *spec_version;
63
+
64
+    if (!notify_get_server_info(&name, &vendor, &version, &spec_version)) {
65
+        g_printerr("Unable to get server information");
66
+        exit(1);
67
+    }
68
+
69
+    g_print("name:%s\nvendor:%s\nversion:%s\nspec_version:%s\n", name,
70
+                                                                 vendor,
71
+                                                                 version,
72
+                                                                 spec_version);
73
+}
74
+
75
+void parse_commandline(int argc, char *argv[])
76
+{
77
+    GError *error = NULL;
78
+    GOptionContext *context;
79
+
80
+    context = g_option_context_new("- Dunstify");
81
+    g_option_context_add_main_entries(context, entries, NULL);
82
+    if (!g_option_context_parse(context, &argc, &argv, &error)){
83
+        g_printerr("Invalid commandline: %s\n", error->message);
84
+        exit(1);
85
+    }
86
+
87
+    g_option_context_free(context);
88
+
89
+    if (capabilities) {
90
+        print_capabilities();
91
+        die(0);
92
+    }
93
+
94
+    if (serverinfo) {
95
+        print_serverinfo();
96
+        die(0);
97
+    }
98
+
99
+    if (argc < 2 && close_id < 1) {
100
+        g_printerr("I need at least a summary\n");
101
+        die(1);
102
+    } else if (argc < 2) {
103
+        summary = g_strdup("These are not the summaries you are looking for");
104
+    } else {
105
+        summary = g_strdup(argv[1]);
106
+    }
107
+
108
+    if (argc > 2) {
109
+        body = g_strdup(argv[2]);
110
+    }
111
+
112
+    if (urgency_str) {
113
+        switch (urgency_str[0]) {
114
+            case 'l':
115
+            case 'L':
116
+            case '0':
117
+                urgency = NOTIFY_URGENCY_LOW;
118
+                break;
119
+            case 'n':
120
+            case 'N':
121
+            case '1':
122
+                urgency = NOTIFY_URGENCY_NORMAL;
123
+                break;
124
+            case 'c':
125
+            case 'C':
126
+            case '2':
127
+                urgency = NOTIFY_URGENCY_CRITICAL;
128
+                break;
129
+            default:
130
+                g_printerr("Unknown urgency: %s\n", urgency_str);
131
+                g_printerr("Assuming normal urgency\n");
132
+                break;
133
+        }
134
+    }
135
+}
136
+
137
+typedef struct _NotifyNotificationPrivate
138
+{
139
+        guint32         id;
140
+        char           *app_name;
141
+        char           *summary;
142
+        char           *body;
143
+
144
+        /* NULL to use icon data. Anything else to have server lookup icon */
145
+        char           *icon_name;
146
+
147
+        /*
148
+         * -1   = use server default
149
+         *  0   = never timeout
150
+         *  > 0 = Number of milliseconds before we timeout
151
+         */
152
+        gint            timeout;
153
+
154
+        GSList         *actions;
155
+        GHashTable     *action_map;
156
+        GHashTable     *hints;
157
+
158
+        gboolean        has_nondefault_actions;
159
+        gboolean        updates_pending;
160
+
161
+        gulong          proxy_signal_handler;
162
+
163
+        gint            closed_reason;
164
+} knickers;
165
+
166
+int get_id(NotifyNotification *n)
167
+{
168
+    knickers *kn = n->priv;
169
+
170
+    /* I'm sorry for taking a peek */
171
+    return kn->id;
172
+}
173
+
174
+int put_id(NotifyNotification *n, guint32 id)
175
+{
176
+    knickers *kn = n->priv;
177
+
178
+    /* And know I'm putting stuff into
179
+     * your knickers. I'm sorry.
180
+     * I'm so sorry.
181
+     * */
182
+
183
+    kn->id = id;
184
+}
185
+
186
+void actioned(NotifyNotification *n, char *a, gpointer foo)
187
+{
188
+    notify_notification_close(n, NULL);
189
+    g_print("%s\n", a);
190
+    die(0);
191
+}
192
+
193
+void closed(NotifyNotification *n, gpointer foo)
194
+{
195
+    g_print("%d\n", notify_notification_get_closed_reason(n));
196
+    die(0);
197
+}
198
+
199
+void add_action(NotifyNotification *n, char *str)
200
+{
201
+    char *action = str;
202
+    char *label = strstr(str, ",");
203
+
204
+    if (!label || *(label+1) == '\0') {
205
+        g_printerr("Malformed action. Excpected \"action,label\", got \"%s\"", str);
206
+        return;
207
+    }
208
+
209
+    *label = '\0';
210
+    label++;
211
+
212
+    notify_notification_add_action(n, action, label, actioned, NULL, NULL);
213
+}
214
+
215
+void add_hint(NotifyNotification *n, char *str)
216
+{
217
+    char *type = str;
218
+    char *name = strstr(str, ":");
219
+    if (!name || *(name+1) == '\0') {
220
+        g_printerr("Malformed hint. Expected \"type:name:value\", got \"%s\"", str);
221
+        return;
222
+    }
223
+    *name = '\0';
224
+    name++;
225
+    char *value = strstr(name, ":");
226
+    if (!value || *(value+1) == '\0') {
227
+        g_printerr("Malformed hint. Expected \"type:name:value\", got \"%s\"", str);
228
+        return;
229
+    }
230
+    *value = '\0';
231
+    value++;
232
+
233
+    if (strcmp(type, "int") == 0)
234
+        notify_notification_set_hint_int32(n, name, atoi(value));
235
+    else if (strcmp(type, "double") == 0)
236
+        notify_notification_set_hint_double(n, name, atof(value));
237
+    else if (strcmp(type, "string") == 0)
238
+        notify_notification_set_hint_string(n, name, value);
239
+    else if (strcmp(type, "byte") == 0) {
240
+        gint h_byte = g_ascii_strtoull(value, NULL, 10);
241
+        if (h_byte < 0 || h_byte > 0xFF)
242
+            g_printerr("Not a byte: \"%s\"", value);
243
+        else
244
+            notify_notification_set_hint_byte(n, name, (guchar) h_byte);
245
+    } else
246
+        g_printerr("Malformed hint. Expected a type of int, double, string or byte, got %s\n", type);
247
+
248
+}
249
+
250
+int main(int argc, char *argv[])
251
+{
252
+    #if !GLIB_CHECK_VERSION(2,35,0)
253
+        g_type_init();
254
+    #endif
255
+    parse_commandline(argc, argv);
256
+
257
+    if (!notify_init(appname)) {
258
+        g_printerr("Unable to initialize libnotify\n");
259
+        die(1);
260
+    }
261
+
262
+    NotifyNotification *n;
263
+    n = notify_notification_new(summary, body, icon);
264
+    notify_notification_set_timeout(n, timeout);
265
+    notify_notification_set_urgency(n, urgency);
266
+
267
+    GError *err = NULL;
268
+
269
+    if (close_id > 0) {
270
+        put_id(n, close_id);
271
+        notify_notification_close(n, &err);
272
+        if (err) {
273
+            g_printerr("Unable to close notification: %s\n", err->message);
274
+            die(1);
275
+        }
276
+        die(0);
277
+    }
278
+
279
+    if (replace_id > 0) {
280
+        put_id(n, replace_id);
281
+    }
282
+
283
+    GMainLoop *l = NULL;
284
+
285
+    if (block || action_strs)
286
+        l = g_main_loop_new(NULL, false);
287
+        g_signal_connect(n, "closed", G_CALLBACK(closed), NULL);
288
+
289
+    if (action_strs)
290
+        for (int i = 0; action_strs[i]; i++) {
291
+            add_action(n, action_strs[i]);
292
+        }
293
+
294
+    if (hint_strs)
295
+        for (int i = 0; hint_strs[i]; i++) {
296
+            add_hint(n, hint_strs[i]);
297
+        }
298
+
299
+
300
+    notify_notification_show(n, &err);
301
+    if (err) {
302
+        g_printerr("Unable to send notification: %s\n", err->message);
303
+        die(1);
304
+    }
305
+
306
+    if (block || action_strs)
307
+        g_main_loop_run(l);
308
+
309
+    if (printid) {
310
+       g_print("%d\n", get_id(n));
311
+    }
312
+
313
+    die(0);
314
+}

Loading…
Cancel
Save