-
Notifications
You must be signed in to change notification settings - Fork 343
/
settings_data.h
1356 lines (1320 loc) · 49.6 KB
/
settings_data.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#ifndef DUNST_SETTING_DATA_H
#define DUNST_SETTING_DATA_H
#include <stddef.h>
#include <pango/pango-layout.h>
#include "option_parser.h"
#include "settings.h"
#include "rules.h"
struct string_to_enum_def {
const char* string;
const int enum_value;
};
struct setting {
/**
* A string with the setting key as found in the config file.
*/
char *name;
/**
* A string with the ini section where the variable is allowed. This
* section should be part of the special_sections array.
*
* Example:
* .section = "global",
*/
char *section;
/**
* A string with a short description of the config variable. This is
* currently not used, but it may be used to generate help messages.
*/
char *description;
// IDEA: Add long description to generate man page from this. This could
// also be useful for an extended help text.
/**
* Enum of the setting type. Every setting type is parsed differently in
* option_parser.c.
*/
enum setting_type type;
/**
* A string with the default value of the setting. This should be the
* same as what it would be in the config file, as this is parsed by the
* same parser.
* default_value is unused when the setting is only a rule (value == NULL).
*
* Example:
* .default_value = "10s", // 10 seconds of time
*/
char *default_value;
/**
* (nullable)
* A pointer to the corresponding setting in the setting struct. Make
* sure to always take the address, even if it's already a pointer in the
* settings struct.
* If value is NULL, the setting is interpreted as a rule.
*
* Example:
* .value = &settings.font,
*/
void *value;
/**
* (nullable)
* Function pointer for the parser - to be used in case of enums or other
* special settings. If the parse requires extra data, it should be given
* with parser_data. This allows for one generic parser for, for example,
* enums, instead of a parser for every enum.
*
* @param data The required data for parsing the value. See parser_data.
* @param cfg_value The string representing the value of the config
* variable
* @param ret A pointer to the return value. This casted by the parser to
* the right type.
*/
int (*parser)(const void* data, const char *cfg_value, void* ret);
/**
* (nullable)
* A pointer to the data required for the parser to parse this setting.
*/
const void* parser_data; // This is passed to the parser function
/**
* The offset of this setting in the rule struct, if it exists. Zero is
* being interpreted as if no rule exists for this setting.
*
* Example:
* .rule_offset = offsetof(struct rule, *member*);
*/
size_t rule_offset;
};
static const struct rule empty_rule = {
.name = "empty",
.appname = NULL,
.summary = NULL,
.body = NULL,
.icon = NULL,
.category = NULL,
.msg_urgency = URG_NONE,
.timeout = -1,
.urgency = URG_NONE,
.markup = MARKUP_NULL,
.history_ignore = -1,
.match_transient = -1,
.set_transient = -1,
.set_icon_size = -1,
.skip_display = -1,
.word_wrap = -1,
.ellipsize = -1,
.alignment = -1,
.new_icon = NULL,
.fg = NULL,
.bg = NULL,
.format = NULL,
.default_icon = NULL,
.script = NULL,
.enabled = true,
};
#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM
#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM
// Needed for compiling without wayland dependency
const enum zwlr_layer_shell_v1_layer {
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0,
ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1,
ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2,
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3,
};
#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */
enum list_type {
INVALID_LIST = 0,
MOUSE_LIST = 1,
OFFSET_LIST = 2,
STRING_LIST = 3,
};
#define ENUM_END {NULL, 0}
static const struct string_to_enum_def verbosity_enum_data[] = {
{"critical", G_LOG_LEVEL_CRITICAL },
{"crit", G_LOG_LEVEL_CRITICAL },
{"warning", G_LOG_LEVEL_WARNING },
{"warn", G_LOG_LEVEL_WARNING },
{"message", G_LOG_LEVEL_MESSAGE },
{"mesg", G_LOG_LEVEL_MESSAGE },
{"info", G_LOG_LEVEL_INFO },
{"debug", G_LOG_LEVEL_DEBUG },
{"deb", G_LOG_LEVEL_DEBUG },
ENUM_END,
};
static const struct string_to_enum_def boolean_enum_data[] = {
{"True", true },
{"true", true },
{"On", true },
{"on", true },
{"Yes", true },
{"yes", true },
{"1", true },
{"False", false },
{"false", false },
{"Off", false },
{"off", false },
{"No", false },
{"no", false },
{"0", false },
{"n", false },
{"y", false },
{"N", false },
{"Y", true },
ENUM_END,
};
static const struct string_to_enum_def horizontal_alignment_enum_data[] = {
{"left", PANGO_ALIGN_LEFT },
{"center", PANGO_ALIGN_CENTER },
{"right", PANGO_ALIGN_RIGHT },
ENUM_END,
};
static const struct string_to_enum_def ellipsize_enum_data[] = {
{"start", PANGO_ELLIPSIZE_START },
{"middle", PANGO_ELLIPSIZE_MIDDLE },
{"end", PANGO_ELLIPSIZE_END },
ENUM_END,
};
static struct string_to_enum_def follow_mode_enum_data[] = {
{"mouse", FOLLOW_MOUSE },
{"keyboard", FOLLOW_KEYBOARD },
{"none", FOLLOW_NONE },
ENUM_END,
};
static const struct string_to_enum_def fullscreen_enum_data[] = {
{"show", FS_SHOW },
{"delay", FS_DELAY },
{"pushback", FS_PUSHBACK },
ENUM_END,
};
static const struct string_to_enum_def icon_position_enum_data[] = {
{"left", ICON_LEFT },
{"right", ICON_RIGHT },
{"off", ICON_OFF },
ENUM_END,
};
static const struct string_to_enum_def vertical_alignment_enum_data[] = {
{"top", VERTICAL_TOP },
{"center", VERTICAL_CENTER },
{"bottom", VERTICAL_BOTTOM },
ENUM_END,
};
static const struct string_to_enum_def markup_mode_enum_data[] = {
{"strip", MARKUP_STRIP },
{"no", MARKUP_NO },
{"full", MARKUP_FULL },
{"yes", MARKUP_FULL },
ENUM_END,
};
static const struct string_to_enum_def mouse_action_enum_data[] = {
{"none", MOUSE_NONE },
{"do_action", MOUSE_DO_ACTION },
{"close_current", MOUSE_CLOSE_CURRENT },
{"close_all", MOUSE_CLOSE_ALL },
{"context", MOUSE_CONTEXT },
{"context_all", MOUSE_CONTEXT_ALL },
{"open_url", MOUSE_OPEN_URL },
ENUM_END,
};
static const struct string_to_enum_def sep_color_enum_data[] = {
{"auto", SEP_AUTO },
{"foreground", SEP_FOREGROUND },
{"frame", SEP_FRAME },
ENUM_END,
};
static const struct string_to_enum_def urgency_enum_data[] = {
{"low", URG_LOW },
{"normal", URG_NORM },
{"critical", URG_CRIT },
ENUM_END,
};
static const struct string_to_enum_def layer_enum_data[] = {
{"bottom", ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM },
{"top", ZWLR_LAYER_SHELL_V1_LAYER_TOP },
{"overlay", ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY },
ENUM_END,
};
static const struct string_to_enum_def origin_enum_data[] = {
{ "top-left", ORIGIN_TOP_LEFT },
{ "top-center", ORIGIN_TOP_CENTER },
{ "top-right", ORIGIN_TOP_RIGHT },
{ "bottom-left", ORIGIN_BOTTOM_LEFT },
{ "bottom-center", ORIGIN_BOTTOM_CENTER },
{ "bottom-right", ORIGIN_BOTTOM_RIGHT },
{ "left-center", ORIGIN_LEFT_CENTER },
{ "right-center", ORIGIN_RIGHT_CENTER },
{ "center", ORIGIN_CENTER },
ENUM_END,
};
static const struct setting allowed_settings[] = {
// These icon settings have to be above the icon rule
{
.name = "icon",
.section = "urgency_low",
.description = "Icon for notifications with low urgency",
.type = TYPE_STRING,
.default_value = "dialog-information",
.value = &settings.icons[URG_LOW],
.parser = NULL,
.parser_data = NULL,
},
{
.name = "icon",
.section = "urgency_normal",
.description = "Icon for notifications with normal urgency",
.type = TYPE_STRING,
.default_value = "dialog-information",
.value = &settings.icons[URG_NORM],
.parser = NULL,
.parser_data = NULL,
},
{
.name = "icon",
.section = "urgency_critical",
.description = "Icon for notifications with critical urgency",
.type = TYPE_STRING,
.default_value = "dialog-warning",
.value = &settings.icons[URG_CRIT],
.parser = NULL,
.parser_data = NULL,
},
// filtering rules below
{
.name = "appname",
.section = "*",
.description = "The name of the application as reported by the client. Be aware that the name can often differ depending on the locale used.",
.type = TYPE_STRING,
.default_value = "*", // default_value is not used for rules
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, appname),
},
{
.name = "body",
.section = "*",
.description = "The body of the notification",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, body),
},
{
.name = "category",
.section = "*",
.description = "The category of the notification as defined by the notification spec. See https://specifications.freedesktop.org/notification-spec/latest/ar01s06.html",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, category),
},
{
.name = "desktop_entry",
.section = "*",
.description = "GLib based applications export their desktop-entry name. In comparison to the appname, the desktop-entry won't get localized.",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, desktop_entry),
},
{
.name = "icon",
.section = "*",
.description = "The icon of the notification in the form of a file path. Can be empty if no icon is available or a raw icon is used instead.",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, icon),
},
{
.name = "match_transient",
.section = "*",
.description = "Match if the notification has been declared as transient by the client or by some other rule.",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
.rule_offset = offsetof(struct rule, match_transient),
},
{
.name = "msg_urgency",
.section = "*",
.description = "Matches the urgency of the notification as set by the client or by some other rule.",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = urgency_enum_data,
.rule_offset = offsetof(struct rule, msg_urgency),
},
{
.name = "stack_tag",
.section = "*",
.description = "Matches the stack tag of the notification as set by the client or by some other rule.",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, stack_tag),
},
{
.name = "summary",
.section = "*",
.description = "summary text of the notification",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, summary),
},
// modifying rules below
{
.name = "script",
.section = "*",
.description = "script",
.type = TYPE_PATH,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, script),
},
{
.name = "background",
.section = "*",
.description = "The background color of the notification.",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, bg),
},
{
.name = "foreground",
.section = "*",
.description = "The foreground color of the notification.",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, fg),
},
{
.name = "highlight",
.section = "*",
.description = "The highlight color of the notification.",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, highlight),
},
{
.name = "default_icon",
.section = "*",
.description = "The default icon that is used when no icon is passed",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, default_icon),
},
{
.name = "format",
.section = "global",
.description = "The format template for the notifications",
.type = TYPE_STRING,
.default_value = "<b>%s</b>\n%b",
.value = &settings.format,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, format),
},
{
.name = "fullscreen",
.section = "*",
.description = "This attribute specifies how notifications are handled if a fullscreen window is focused. One of show, delay, or pushback.",
.type = TYPE_CUSTOM,
.default_value = "show",
.value = NULL,
.parser = string_parse_enum,
.parser_data = fullscreen_enum_data,
.rule_offset = offsetof(struct rule, fullscreen),
},
{
.name = "new_icon",
.section = "*",
.description = "Updates the icon of the notification, it should be a path to a valid image.",
.type = TYPE_PATH,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, new_icon),
},
{
.name = "set_stack_tag",
.section = "*",
.description = "Sets the stack tag for the notification, notifications with the same (non-empty) stack tag will replace each-other so only the newest one is visible.",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, set_stack_tag),
},
{
.name = "set_transient",
.section = "*",
.description = "Sets whether the notification is considered transient. Transient notifications will bypass the idle_threshold setting.",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
.rule_offset = offsetof(struct rule, set_transient),
},
{
.name = "set_category",
.section = "*",
.description = "The category of the notification as defined by the notification spec. See https://specifications.freedesktop.org/notification-spec/latest/ar01s06.html",
.type = TYPE_STRING,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, set_category),
},
{
.name = "timeout",
.section = "*",
.description = "Don't timeout notifications if user is longer idle than threshold",
.type = TYPE_TIME,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, timeout),
},
{
.name = "urgency",
.section = "*",
.description = "This sets the notification urgency.",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = urgency_enum_data,
.rule_offset = offsetof(struct rule, urgency),
},
{
.name = "skip_display",
.section = "*",
.description = "Setting this to true will prevent the notification from being displayed initially but will be saved in history for later viewing.",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
.rule_offset = offsetof(struct rule, skip_display),
},
{
.name = "history_ignore",
.section = "*",
.description = "Setting this to true will display the notification initially, but stop it from being recalled via the history.",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
.rule_offset = offsetof(struct rule, history_ignore),
},
{
.name = "word_wrap",
.section = "*",
.description = "Wrap long lines of text",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
.rule_offset = offsetof(struct rule, word_wrap),
},
{
.name = "ellipsize",
.section = "*",
.description = "Ellipsize truncated lines on the start/middle/end",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = ellipsize_enum_data,
.rule_offset = offsetof(struct rule, ellipsize),
},
{
.name = "alignment",
.section = "*",
.description = "Text alignment left/center/right",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = horizontal_alignment_enum_data,
.rule_offset = offsetof(struct rule, alignment),
},
{
.name = "markup",
.section = "*",
.description = "Specify how markup should be handled",
.type = TYPE_CUSTOM,
.default_value = "*",
.value = NULL,
.parser = string_parse_enum,
.parser_data = markup_mode_enum_data,
.rule_offset = offsetof(struct rule, markup),
},
{
.name = "icon_size",
.section = "*",
.description = "Set the size of the icon",
.type = TYPE_INT,
.default_value = "*",
.value = NULL,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, set_icon_size),
},
{
.name = "enabled",
.section = "*",
.description = "Enable or disable a rule",
.type = TYPE_CUSTOM,
.default_value = "true",
.value = NULL,
.parser = string_parse_bool,
.parser_data = boolean_enum_data,
.rule_offset = offsetof(struct rule, enabled),
},
// end of modifying rules
// other settings below
{
.name = "frame_color",
.section = "*",
.description = "Color of the frame around the window",
.type = TYPE_STRING,
.default_value = "#888888",
.value = &settings.frame_color,
.parser = NULL,
.parser_data = NULL,
.rule_offset = offsetof(struct rule, fc),
},
{
.name = "per_monitor_dpi",
.section = "experimental",
.description = "Use a different DPI per monitor",
.type = TYPE_CUSTOM,
.default_value = "false",
.value = &settings.per_monitor_dpi,
.parser = string_parse_bool,
.parser_data = boolean_enum_data,
},
{
.name = "force_xinerama",
.section = "global",
.description = "Force the use of the Xinerama extension",
.type = TYPE_CUSTOM,
.default_value = "false",
.value = &settings.force_xinerama,
.parser = string_parse_bool,
.parser_data = boolean_enum_data,
},
{
.name = "force_xwayland",
.section = "global",
.description = "Force the use of the xwayland output",
.type = TYPE_CUSTOM,
.default_value = "false",
.value = &settings.force_xwayland,
.parser = string_parse_bool,
.parser_data = boolean_enum_data,
},
{
.name = "font",
.section = "global",
.description = "The font dunst should use.",
.type = TYPE_STRING,
.default_value = "Monospace 8",
.value = &settings.font,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "sort",
.section = "global",
.description = "Sort notifications by urgency and date?",
.type = TYPE_CUSTOM,
.default_value = "true",
.value = &settings.sort,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
},
{
.name = "indicate_hidden",
.section = "global",
.description = "Show how many notifications are hidden",
.type = TYPE_CUSTOM,
.default_value = "true",
.value = &settings.indicate_hidden,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
},
{
.name = "ignore_dbusclose",
.section = "global",
.description = "Ignore dbus CloseNotification events",
.type = TYPE_CUSTOM,
.default_value = "false",
.value = &settings.ignore_dbusclose,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
},
{
.name = "ignore_newline",
.section = "global",
.description = "Ignore newline characters in notifications",
.type = TYPE_CUSTOM,
.default_value = "false",
.value = &settings.ignore_newline,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
},
{
.name = "idle_threshold",
.section = "global",
.description = "Don't timeout notifications if user is longer idle than threshold",
.type = TYPE_TIME,
.default_value = "0",
.value = &settings.idle_threshold,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "monitor",
.section = "global",
.description = "On which monitor should the notifications be displayed",
.type = TYPE_INT,
.default_value = "0",
.value = &settings.monitor,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "title",
.section = "global",
.description = "Define the title of windows spawned by dunst.",
.type = TYPE_STRING,
.default_value = "Dunst",
.value = &settings.title,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "class",
.section = "global",
.description = "Define the class of windows spawned by dunst.",
.type = TYPE_STRING,
.default_value = "Dunst",
.value = &settings.class,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "shrink",
.section = "global",
.description = "Shrink window if it's smaller than the width",
.type = TYPE_CUSTOM,
.default_value = "false",
.value = &settings.shrink,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
},
{
.name = "line_height",
.section = "global",
.description = "Add spacing between lines of text",
.type = TYPE_INT,
.default_value = "0",
.value = &settings.line_height,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "show_age_threshold",
.section = "global",
.description = "When should the age of the notification be displayed?",
.type = TYPE_TIME,
.default_value = "60",
.value = &settings.show_age_threshold,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "hide_duplicate_count",
.section = "global",
.description = "Hide the count of stacked notifications with the same content",
.type = TYPE_CUSTOM,
.default_value = "false",
.value = &settings.hide_duplicate_count,
.parser = string_parse_bool,
.parser_data = boolean_enum_data,
},
{
.name = "sticky_history",
.section = "global",
.description = "Don't timeout notifications popped up from history",
.type = TYPE_CUSTOM,
.default_value = "true",
.value = &settings.sticky_history,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
},
{
.name = "history_length",
.section = "global",
.description = "Max amount of notifications kept in history",
.type = TYPE_INT,
.default_value = "20",
.value = &settings.history_length,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "show_indicators",
.section = "global",
.description = "Show indicators for actions \"(A)\" and URLs \"(U)\"",
.type = TYPE_CUSTOM,
.default_value = "true",
.value = &settings.show_indicators,
.parser = string_parse_enum,
.parser_data = boolean_enum_data,
},
{
.name = "separator_height",
.section = "global",
.description = "height of the separator line",
.type = TYPE_INT,
.default_value = "2",
.value = &settings.separator_height,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "padding",
.section = "global",
.description = "Padding between text and separator",
.type = TYPE_INT,
.default_value = "8",
.value = &settings.padding,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "horizontal_padding",
.section = "global",
.description = "horizontal padding",
.type = TYPE_INT,
.default_value = "8",
.value = &settings.h_padding,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "text_icon_padding",
.section = "global",
.description = "Padding between text and icon",
.type = TYPE_INT,
.default_value = "0",
.value = &settings.text_icon_padding,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "transparency",
.section = "global",
.description = "Transparency. Range 0-100",
.type = TYPE_INT,
.default_value = "0",
.value = &settings.transparency,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "corner_radius",
.section = "global",
.description = "Window corner radius",
.type = TYPE_INT,
.default_value = "0",
.value = &settings.corner_radius,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "progress_bar_height",
.section = "global",
.description = "Height of the progress bar",
.type = TYPE_INT,
.default_value = "10",
.value = &settings.progress_bar_height,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "progress_bar_min_width",
.section = "global",
.description = "Minimum width of the progress bar",
.type = TYPE_INT,
.default_value = "150",
.value = &settings.progress_bar_min_width,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "progress_bar_max_width",
.section = "global",
.description = "Maximum width of the progress bar",
.type = TYPE_INT,
.default_value = "300",
.value = &settings.progress_bar_max_width,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "progress_bar_frame_width",
.section = "global",
.description = "Frame width of the progress bar",
.type = TYPE_INT,
.default_value = "1",
.value = &settings.progress_bar_frame_width,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "progress_bar",
.section = "global",
.description = "Show the progress bar",
.type = TYPE_CUSTOM,
.default_value = "true",
.value = &settings.progress_bar,
.parser = string_parse_bool,
.parser_data = boolean_enum_data,
},
{
.name = "stack_duplicates",
.section = "global",
.description = "Stack together notifications with the same content",
.type = TYPE_CUSTOM,
.default_value = "true",
.value = &settings.stack_duplicates,
.parser = string_parse_bool,
.parser_data = boolean_enum_data,
},
{
.name = "dmenu",
.section = "global",
.description = "path to dmenu",
.type = TYPE_PATH,
.default_value = "/usr/bin/dmenu -p dunst",
.value = &settings.dmenu,
.parser = NULL,
.parser_data = &settings.dmenu_cmd,
},
{
.name = "browser",
.section = "global",
.description = "path to browser",
.type = TYPE_PATH,
.default_value = "/usr/bin/xdg-open",
.value = &settings.browser,
.parser = NULL,
.parser_data = &settings.browser_cmd,
},
{
.name = "min_icon_size",
.section = "global",
.description = "Scale smaller icons up to this size, set to 0 to disable. If max_icon_size also specified, that has the final say.",
.type = TYPE_INT,
.default_value = "0",
.value = &settings.min_icon_size,
.parser = NULL,
.parser_data = NULL,
},
{
.name = "max_icon_size",
.section = "global",