Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
settings_data.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
10
11#ifndef DUNST_SETTING_DATA_H
12#define DUNST_SETTING_DATA_H
13
14#include <stddef.h>
15#include <pango/pango-layout.h>
16
17#include "option_parser.h"
18#include "settings.h"
19#include "rules.h"
20
22 const char* string;
23 const int enum_value;
24};
25
26struct setting {
30 char *name;
31
39 char *section;
40
46
47 // IDEA: Add long description to generate man page from this. This could
48 // also be useful for an extended help text.
49
54 enum setting_type type;
55
66
77 void *value;
78
79
93 int (*parser)(const void* data, const char *cfg_value, void* ret);
94
99 const void* parser_data; // This is passed to the parser function
100
109
119};
120
121
122/*
123 * How to add/change a rule
124 * ------------------------
125 *
126 * - Add variable to `struct rules` in `rules.h` (make sure to read the comment
127 * at the top of the struct)
128 * - Add variable to to `struct notification` in `notification.h`
129 * - Apply the rule in `rule_apply` in `rules.c`
130 * - Change the listing in `settings_data.h` (make sure to move it to the other
131 * rule listings for clarity)
132 * - Add the default rule value in `settings_data.h` (usually -1 or NULL)
133 * - Set default value in notification.c (`notification_create`). This is where
134 * the real default is set.
135 * - Add the rule to the output of `dbus_cb_dunst_RuleList` in `dbus.c`.
136 * - Free the variable in `notification.c` if dynamically allocated.
137 * - Free the variable in `rules.c` if dynamically allocated.
138 * - Remove the setting from the global settings struct in `settings.h`.
139 * - Actually use the new setting.
140 * - Update the documentation
141 * - Test that it works
142 *
143 * An example of making a setting a rule can be found in commit edc6f5a8c7a51a56b591cfa72618a43adc7b8d11
144 */
145
146static const struct rule empty_rule = {
147 .name = "empty",
148 .appname = NULL,
149 .action_name = NULL,
150 .summary = NULL,
151 .body = NULL,
152 .icon = NULL,
153 .category = NULL,
154 .msg_urgency = URG_NONE,
155 .match_dbus_timeout = -1,
156 .timeout = -1,
157 .override_dbus_timeout = -1,
158 .urgency = URG_NONE,
159 .markup = MARKUP_NULL,
160 .history_ignore = -1,
161 .match_transient = -1,
162 .set_transient = -1,
163 .icon_position = -1,
164 .skip_display = -1,
165 .word_wrap = -1,
166 .ellipsize = -1,
167 .alignment = -1,
168 .hide_text = -1,
169 .new_icon = NULL,
170 .default_icon = NULL,
171 .fg = COLOR_UNINIT,
172 .bg = COLOR_UNINIT,
173 .highlight = NULL,
174 .fc = COLOR_UNINIT,
175 .format = NULL,
176 .script = NULL,
177 .enabled = true,
178 .progress_bar_alignment = -1,
179 .min_icon_size = -1,
180 .max_icon_size = -1,
181 .fullscreen = FS_NULL,
182 .override_pause_level = -1
183};
184
185
186#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM
187#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM
188// Needed for compiling without wayland dependency
189const enum zwlr_layer_shell_v1_layer {
190 ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0,
191 ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1,
192 ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2,
193 ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3,
194};
195#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */
196
197enum list_type {
198 INVALID_LIST = 0,
199 MOUSE_LIST = 1,
200 OFFSET_LIST = 2,
201 STRING_LIST = 3,
202};
203
204#define ENUM_END {NULL, 0}
205static const struct string_to_enum_def verbosity_enum_data[] = {
206 {"critical", G_LOG_LEVEL_CRITICAL },
207 {"crit", G_LOG_LEVEL_CRITICAL },
208 {"warning", G_LOG_LEVEL_WARNING },
209 {"warn", G_LOG_LEVEL_WARNING },
210 {"message", G_LOG_LEVEL_MESSAGE },
211 {"mesg", G_LOG_LEVEL_MESSAGE },
212 {"info", G_LOG_LEVEL_INFO },
213 {"debug", G_LOG_LEVEL_DEBUG },
214 {"deb", G_LOG_LEVEL_DEBUG },
215 ENUM_END,
216};
217
218static const struct string_to_enum_def boolean_enum_data[] = {
219 {"True", true },
220 {"true", true },
221 {"On", true },
222 {"on", true },
223 {"Yes", true },
224 {"yes", true },
225 {"1", true },
226 {"False", false },
227 {"false", false },
228 {"Off", false },
229 {"off", false },
230 {"No", false },
231 {"no", false },
232 {"0", false },
233 {"n", false },
234 {"y", false },
235 {"N", false },
236 {"Y", true },
237 ENUM_END,
238};
239
240static const struct string_to_enum_def sort_type_enum_data[] = {
241 {"True", SORT_TYPE_URGENCY_DESCENDING },
242 {"true", SORT_TYPE_URGENCY_DESCENDING },
243 {"On", SORT_TYPE_URGENCY_DESCENDING },
244 {"on", SORT_TYPE_URGENCY_DESCENDING },
245 {"Yes", SORT_TYPE_URGENCY_DESCENDING },
246 {"yes", SORT_TYPE_URGENCY_DESCENDING },
247 {"1", SORT_TYPE_URGENCY_DESCENDING },
248 {"False", SORT_TYPE_ID },
249 {"false", SORT_TYPE_ID },
250 {"Off", SORT_TYPE_ID },
251 {"off", SORT_TYPE_ID },
252 {"No", SORT_TYPE_ID },
253 {"no", SORT_TYPE_ID },
254 {"0", SORT_TYPE_ID },
255 {"n", SORT_TYPE_ID },
256 {"y", SORT_TYPE_ID },
257 {"N", SORT_TYPE_ID },
258 {"Y", SORT_TYPE_URGENCY_DESCENDING },
259 {"id", SORT_TYPE_ID},
260 {"urgency_ascending", SORT_TYPE_URGENCY_ASCENDING },
261 {"urgency_descending", SORT_TYPE_URGENCY_DESCENDING },
262 {"update", SORT_TYPE_UPDATE },
263 ENUM_END,
264};
265
266static const struct string_to_enum_def horizontal_alignment_enum_data[] = {
267 {"left", PANGO_ALIGN_LEFT },
268 {"center", PANGO_ALIGN_CENTER },
269 {"right", PANGO_ALIGN_RIGHT },
270 ENUM_END,
271};
272
273static const struct string_to_enum_def ellipsize_enum_data[] = {
274 {"start", PANGO_ELLIPSIZE_START },
275 {"middle", PANGO_ELLIPSIZE_MIDDLE },
276 {"end", PANGO_ELLIPSIZE_END },
277 ENUM_END,
278};
279
280static struct string_to_enum_def follow_mode_enum_data[] = {
281 {"mouse", FOLLOW_MOUSE },
282 {"keyboard", FOLLOW_KEYBOARD },
283 {"none", FOLLOW_NONE },
284 ENUM_END,
285};
286
287static const struct string_to_enum_def fullscreen_enum_data[] = {
288 {"show", FS_SHOW },
289 {"delay", FS_DELAY },
290 {"pushback", FS_PUSHBACK },
291 ENUM_END,
292};
293
294static const struct string_to_enum_def icon_position_enum_data[] = {
295 {"left", ICON_LEFT },
296 {"right", ICON_RIGHT },
297 {"top", ICON_TOP },
298 {"off", ICON_OFF },
299 ENUM_END,
300};
301
302static const struct string_to_enum_def vertical_alignment_enum_data[] = {
303 {"top", VERTICAL_TOP },
304 {"center", VERTICAL_CENTER },
305 {"bottom", VERTICAL_BOTTOM },
306 ENUM_END,
307};
308
309static const struct string_to_enum_def markup_mode_enum_data[] = {
310 {"strip", MARKUP_STRIP },
311 {"no", MARKUP_NO },
312 {"full", MARKUP_FULL },
313 {"yes", MARKUP_FULL },
314 ENUM_END,
315};
316
317static const struct string_to_enum_def mouse_action_enum_data[] = {
318 {"none", MOUSE_NONE },
319 {"do_action", MOUSE_DO_ACTION },
320 {"close_current", MOUSE_CLOSE_CURRENT },
321 {"close_all", MOUSE_CLOSE_ALL },
322 {"context", MOUSE_CONTEXT },
323 {"context_all", MOUSE_CONTEXT_ALL },
324 {"open_url", MOUSE_OPEN_URL },
325 {"remove_current", MOUSE_REMOVE_CURRENT },
326 ENUM_END,
327};
328
329static const struct string_to_enum_def sep_color_enum_data[] = {
330 {"auto", SEP_AUTO },
331 {"foreground", SEP_FOREGROUND },
332 {"frame", SEP_FRAME },
333 ENUM_END,
334};
335
336static const struct string_to_enum_def urgency_enum_data[] = {
337 {"low", URG_LOW },
338 {"normal", URG_NORM },
339 {"critical", URG_CRIT },
340 ENUM_END,
341};
342
343static const struct string_to_enum_def layer_enum_data[] = {
344 {"bottom", ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM },
345 {"top", ZWLR_LAYER_SHELL_V1_LAYER_TOP },
346 {"overlay", ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY },
347 ENUM_END,
348};
349
350static const struct string_to_enum_def origin_enum_data[] = {
351 { "top-left", ORIGIN_TOP_LEFT },
352 { "top-center", ORIGIN_TOP_CENTER },
353 { "top-right", ORIGIN_TOP_RIGHT },
354 { "bottom-left", ORIGIN_BOTTOM_LEFT },
355 { "bottom-center", ORIGIN_BOTTOM_CENTER },
356 { "bottom-right", ORIGIN_BOTTOM_RIGHT },
357 { "left-center", ORIGIN_LEFT_CENTER },
358 { "right-center", ORIGIN_RIGHT_CENTER },
359 { "center", ORIGIN_CENTER },
360 ENUM_END,
361};
362
363static const struct string_to_enum_def corners_enum_data[] = {
364 { "top-left", C_TOP_LEFT },
365 { "top-right", C_TOP_RIGHT },
366 { "bottom-left", C_BOT_LEFT },
367 { "bottom-right", C_BOT_RIGHT },
368 { "left", C_LEFT },
369 { "right", C_RIGHT },
370 { "bottom", C_BOT },
371 { "top", C_TOP },
372 { "all", C_ALL },
373 { "none", C_NONE },
374 ENUM_END,
375};
376
377static const struct setting allowed_settings[] = {
378 // These icon settings have to be above the icon rule
379 {
380 .name = "icon",
381 .section = "urgency_low",
382 .description = "Icon for notifications with low urgency",
383 .type = TYPE_STRING,
384 .default_value = "",
385 .value = &settings.icons[URG_LOW],
386 .parser = NULL,
387 .parser_data = NULL,
388 },
389 {
390 .name = "icon",
391 .section = "urgency_normal",
392 .description = "Icon for notifications with normal urgency",
393 .type = TYPE_STRING,
394 .default_value = "",
395 .value = &settings.icons[URG_NORM],
396 .parser = NULL,
397 .parser_data = NULL,
398 },
399 {
400 .name = "icon",
401 .section = "urgency_critical",
402 .description = "Icon for notifications with critical urgency",
403 .type = TYPE_STRING,
404 .default_value = "",
405 .value = &settings.icons[URG_CRIT],
406 .parser = NULL,
407 .parser_data = NULL,
408 },
409 // filtering rules below
410 {
411 .name = "appname",
412 .section = "*",
413 .description = "The name of the application as reported by the client. Be aware that the name can often differ depending on the locale used.",
414 .type = TYPE_STRING,
415 .default_value = "*", // default_value is not used for rules
416 .value = NULL,
417 .parser = NULL,
418 .parser_data = NULL,
419 .rule_offset = offsetof(struct rule, appname),
420 },
421 {
422 .name = "body",
423 .section = "*",
424 .description = "The body of the notification",
425 .type = TYPE_STRING,
426 .default_value = "*",
427 .value = NULL,
428 .parser = NULL,
429 .parser_data = NULL,
430 .rule_offset = offsetof(struct rule, body),
431 },
432 {
433 .name = "category",
434 .section = "*",
435 .description = "The category of the notification as defined by the notification spec. See https://specifications.freedesktop.org/notification-spec/latest/ar01s06.html",
436 .type = TYPE_STRING,
437 .default_value = "*",
438 .value = NULL,
439 .parser = NULL,
440 .parser_data = NULL,
441 .rule_offset = offsetof(struct rule, category),
442 },
443 {
444 .name = "desktop_entry",
445 .section = "*",
446 .description = "GLib based applications export their desktop-entry name. In comparison to the appname, the desktop-entry won't get localized.",
447 .type = TYPE_STRING,
448 .default_value = "*",
449 .value = NULL,
450 .parser = NULL,
451 .parser_data = NULL,
452 .rule_offset = offsetof(struct rule, desktop_entry),
453 },
454 {
455 .name = "icon",
456 .section = "*",
457 .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.",
458 .type = TYPE_STRING,
459 .default_value = "*",
460 .value = NULL,
461 .parser = NULL,
462 .parser_data = NULL,
463 .rule_offset = offsetof(struct rule, icon),
464 },
465 {
466 .name = "match_transient",
467 .section = "*",
468 .description = "Match if the notification has been declared as transient by the client or by some other rule.",
469 .type = TYPE_CUSTOM,
470 .default_value = "*",
471 .value = NULL,
472 .parser = string_parse_enum,
473 .parser_data = boolean_enum_data,
474 .rule_offset = offsetof(struct rule, match_transient),
475 },
476 {
477 .name = "msg_urgency",
478 .section = "*",
479 .description = "Matches the urgency of the notification as set by the client or by some other rule.",
480 .type = TYPE_CUSTOM,
481 .default_value = "*",
482 .value = NULL,
483 .parser = string_parse_enum,
484 .parser_data = urgency_enum_data,
485 .rule_offset = offsetof(struct rule, msg_urgency),
486 },
487 {
488 .name = "match_dbus_timeout",
489 .section = "*",
490 .description = "Matches the dbus_timeout of the notification",
491 .type = TYPE_TIME,
492 .default_value = "*",
493 .value = NULL,
494 .parser = NULL,
495 .parser_data = NULL,
496 .rule_offset = offsetof(struct rule, match_dbus_timeout),
497 },
498 {
499 .name = "stack_tag",
500 .section = "*",
501 .description = "Matches the stack tag of the notification as set by the client or by some other rule.",
502 .type = TYPE_STRING,
503 .default_value = "*",
504 .value = NULL,
505 .parser = NULL,
506 .parser_data = NULL,
507 .rule_offset = offsetof(struct rule, stack_tag),
508 },
509 {
510 .name = "summary",
511 .section = "*",
512 .description = "summary text of the notification",
513 .type = TYPE_STRING,
514 .default_value = "*",
515 .value = NULL,
516 .parser = NULL,
517 .parser_data = NULL,
518 .rule_offset = offsetof(struct rule, summary),
519 },
520
521 // modifying rules below
522 {
523 .name = "script",
524 .section = "*",
525 .description = "script",
526 .type = TYPE_PATH,
527 .default_value = "*",
528 .value = NULL,
529 .parser = NULL,
530 .parser_data = NULL,
531 .rule_offset = offsetof(struct rule, script),
532 },
533 {
534 .name = "background",
535 .section = "*",
536 .description = "The background color of the notification.",
537 .type = TYPE_COLOR,
538 .default_value = "*",
539 .value = NULL,
540 .parser = NULL,
541 .parser_data = NULL,
542 .rule_offset = offsetof(struct rule, bg),
543 },
544 {
545 .name = "action_name",
546 .section = "*",
547 .description = "Sets the name of the action to be invoked on do_action.",
548 .type = TYPE_STRING,
549 .default_value = "*",
550 .value = NULL,
551 .parser = NULL,
552 .parser_data = NULL,
553 .rule_offset = offsetof(struct rule, action_name),
554 },
555 {
556 .name = "foreground",
557 .section = "*",
558 .description = "The foreground color of the notification.",
559 .type = TYPE_COLOR,
560 .default_value = "*",
561 .value = NULL,
562 .parser = NULL,
563 .parser_data = NULL,
564 .rule_offset = offsetof(struct rule, fg),
565 },
566 {
567 .name = "highlight",
568 .section = "*",
569 .description = "The highlight color of the notification.",
570 .type = TYPE_GRADIENT,
571 .default_value = "*",
572 .value = NULL,
573 .parser = NULL,
574 .parser_data = NULL,
575 .rule_offset = offsetof(struct rule, highlight),
576 },
577 {
578 .name = "default_icon",
579 .section = "*",
580 .description = "The default icon that is used when no icon is passed",
581 .type = TYPE_PATH,
582 .default_value = "*",
583 .value = NULL,
584 .parser = NULL,
585 .parser_data = NULL,
586 .rule_offset = offsetof(struct rule, default_icon),
587 },
588 {
589 .name = "format",
590 .section = "global",
591 .description = "The format template for the notifications",
592 .type = TYPE_STRING,
593 .default_value = "<b>%s</b>\n%b",
594 .value = &settings.format,
595 .parser = NULL,
596 .parser_data = NULL,
597 .rule_offset = offsetof(struct rule, format),
598 },
599 {
600 .name = "fullscreen",
601 .section = "*",
602 .description = "This attribute specifies how notifications are handled if a fullscreen window is focused. One of show, delay, or pushback.",
603 .type = TYPE_CUSTOM,
604 .default_value = "show",
605 .value = NULL,
606 .parser = string_parse_enum,
607 .parser_data = fullscreen_enum_data,
608 .rule_offset = offsetof(struct rule, fullscreen),
609 },
610 {
611 .name = "new_icon",
612 .section = "*",
613 .description = "Updates the icon of the notification, it should be a path to a valid image.",
614 .type = TYPE_PATH,
615 .default_value = "*",
616 .value = NULL,
617 .parser = NULL,
618 .parser_data = NULL,
619 .rule_offset = offsetof(struct rule, new_icon),
620 },
621 {
622 .name = "set_stack_tag",
623 .section = "*",
624 .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.",
625 .type = TYPE_STRING,
626 .default_value = "*",
627 .value = NULL,
628 .parser = NULL,
629 .parser_data = NULL,
630 .rule_offset = offsetof(struct rule, set_stack_tag),
631 },
632 {
633 .name = "set_transient",
634 .section = "*",
635 .description = "Sets whether the notification is considered transient. Transient notifications will bypass the idle_threshold setting.",
636 .type = TYPE_CUSTOM,
637 .default_value = "*",
638 .value = NULL,
639 .parser = string_parse_enum,
640 .parser_data = boolean_enum_data,
641 .rule_offset = offsetof(struct rule, set_transient),
642 },
643 {
644 .name = "set_category",
645 .section = "*",
646 .description = "The category of the notification as defined by the notification spec. See https://specifications.freedesktop.org/notification-spec/latest/ar01s06.html",
647 .type = TYPE_STRING,
648 .default_value = "*",
649 .value = NULL,
650 .parser = NULL,
651 .parser_data = NULL,
652 .rule_offset = offsetof(struct rule, set_category),
653 },
654 {
655 .name = "timeout",
656 .section = "*",
657 .description = "Don't timeout notifications if user is longer idle than threshold",
658 .type = TYPE_TIME,
659 .default_value = "*",
660 .value = NULL,
661 .parser = NULL,
662 .parser_data = NULL,
663 .rule_offset = offsetof(struct rule, timeout),
664 },
665 {
666 .name = "override_dbus_timeout",
667 .section = "*",
668 .description = "Replace the dbus timeout with this value.",
669 .type = TYPE_TIME,
670 .default_value = "*",
671 .value = NULL,
672 .parser = NULL,
673 .parser_data = NULL,
674 .rule_offset = offsetof(struct rule, override_dbus_timeout),
675 },
676 {
677 .name = "urgency",
678 .section = "*",
679 .description = "This sets the notification urgency.",
680 .type = TYPE_CUSTOM,
681 .default_value = "*",
682 .value = NULL,
683 .parser = string_parse_enum,
684 .parser_data = urgency_enum_data,
685 .rule_offset = offsetof(struct rule, urgency),
686 },
687 {
688 .name = "skip_display",
689 .section = "*",
690 .description = "Setting this to true will prevent the notification from being displayed initially but will be saved in history for later viewing.",
691 .type = TYPE_CUSTOM,
692 .default_value = "*",
693 .value = NULL,
694 .parser = string_parse_enum,
695 .parser_data = boolean_enum_data,
696 .rule_offset = offsetof(struct rule, skip_display),
697 },
698 {
699 .name = "history_ignore",
700 .section = "*",
701 .description = "Setting this to true will display the notification initially, but stop it from being recalled via the history.",
702 .type = TYPE_CUSTOM,
703 .default_value = "*",
704 .value = NULL,
705 .parser = string_parse_enum,
706 .parser_data = boolean_enum_data,
707 .rule_offset = offsetof(struct rule, history_ignore),
708 },
709 {
710 .name = "word_wrap",
711 .section = "*",
712 .description = "Wrap long lines of text",
713 .type = TYPE_CUSTOM,
714 .default_value = "*",
715 .value = NULL,
716 .parser = string_parse_enum,
717 .parser_data = boolean_enum_data,
718 .rule_offset = offsetof(struct rule, word_wrap),
719 },
720 {
721 .name = "ellipsize",
722 .section = "*",
723 .description = "Ellipsize truncated lines on the start/middle/end",
724 .type = TYPE_CUSTOM,
725 .default_value = "*",
726 .value = NULL,
727 .parser = string_parse_enum,
728 .parser_data = ellipsize_enum_data,
729 .rule_offset = offsetof(struct rule, ellipsize),
730 },
731 {
732 .name = "alignment",
733 .section = "*",
734 .description = "Text alignment left/center/right",
735 .type = TYPE_CUSTOM,
736 .default_value = "*",
737 .value = NULL,
738 .parser = string_parse_enum,
739 .parser_data = horizontal_alignment_enum_data,
740 .rule_offset = offsetof(struct rule, alignment),
741 },
742 {
743 .name = "hide_text",
744 .section = "*",
745 .description = "Skip rendering summary and body text in notification window (keeps icon and progress bar)",
746 .type = TYPE_CUSTOM,
747 .default_value = "*",
748 .value = NULL,
749 .parser = string_parse_enum,
750 .parser_data = boolean_enum_data,
751 .rule_offset = offsetof(struct rule, hide_text),
752 },
753 {
754 .name = "markup",
755 .section = "*",
756 .description = "Specify how markup should be handled",
757 .type = TYPE_CUSTOM,
758 .default_value = "*",
759 .value = NULL,
760 .parser = string_parse_enum,
761 .parser_data = markup_mode_enum_data,
762 .rule_offset = offsetof(struct rule, markup),
763 },
764 {
765 .name = "icon_position",
766 .section = "*",
767 .description = "Align icons left/right/top/off",
768 .type = TYPE_CUSTOM,
769 .default_value = "*",
770 .value = NULL,
771 .parser = string_parse_enum,
772 .parser_data = icon_position_enum_data,
773 .rule_offset = offsetof(struct rule, icon_position),
774 },
775 {
776 .name = "enabled",
777 .section = "*",
778 .description = "Enable or disable a rule",
779 .type = TYPE_CUSTOM,
780 .default_value = "true",
781 .value = NULL,
782 .parser = string_parse_bool,
783 .parser_data = boolean_enum_data,
784 .rule_offset = offsetof(struct rule, enabled),
785 },
786 {
787 .name = "corners",
788 .section = "global",
789 .description = "Select the corners to round",
790 .type = TYPE_CUSTOM,
791 .default_value = "all",
792 .value = &settings.corners,
793 .parser = string_parse_corners,
794 .parser_data = corners_enum_data,
795 },
796 {
797 .name = "progress_bar_corners",
798 .section = "global",
799 .description = "Select the corners to round for the progress bar",
800 .type = TYPE_CUSTOM,
801 .default_value = "all",
802 .value = &settings.progress_bar_corners,
803 .parser = string_parse_corners,
804 .parser_data = corners_enum_data,
805 },
806 {
807 .name = "icon_corners",
808 .section = "global",
809 .description = "Select the corners to round for the icon image",
810 .type = TYPE_CUSTOM,
811 .default_value = "all",
812 .value = &settings.icon_corners,
813 .parser = string_parse_corners,
814 .parser_data = corners_enum_data,
815 },
816 {
817 .name = "progress_bar_horizontal_alignment",
818 .section = "*",
819 .description = "Set the horizontal alignment of the progress bar",
820 .type = TYPE_CUSTOM,
821 .default_value = "center",
822 .value = NULL,
823 .parser = string_parse_enum,
824 .parser_data = horizontal_alignment_enum_data,
825 .rule_offset = offsetof(struct rule, progress_bar_alignment),
826 },
827 {
828 .name = "min_icon_size",
829 .section = "global",
830 .description = "Scale smaller icons up to this size, set to 0 to disable. If max_icon_size also specified, that has the final say.",
831 .type = TYPE_INT,
832 .default_value = "*",
833 .value = NULL,
834 .parser = NULL,
835 .parser_data = NULL,
836 .rule_offset = offsetof(struct rule, min_icon_size),
837 },
838 {
839 .name = "max_icon_size",
840 .section = "global",
841 .description = "Scale larger icons down to this size, set to 0 to disable",
842 .type = TYPE_INT,
843 .default_value = "*",
844 .value = NULL,
845 .parser = NULL,
846 .parser_data = NULL,
847 .rule_offset = offsetof(struct rule, max_icon_size),
848 },
849 {
850 .name = "override_pause_level",
851 .section = "*",
852 .description = "TODO",
853 .type = TYPE_INT,
854 .default_value = "-1",
855 .value = NULL,
856 .parser = NULL,
857 .parser_data = NULL,
858 .rule_offset = offsetof(struct rule, override_pause_level),
859 },
860 // end of modifying rules
861
862 // other settings below
863 {
864 .name = "frame_color",
865 .section = "*",
866 .description = "Color of the frame around the window",
867 .type = TYPE_COLOR,
868 .default_value = "#888888",
869 .value = &settings.frame_color,
870 .parser = NULL,
871 .parser_data = NULL,
872 .rule_offset = offsetof(struct rule, fc),
873 },
874 {
875 .name = "per_monitor_dpi",
876 .section = "experimental",
877 .description = "Use a different DPI per monitor",
878 .type = TYPE_CUSTOM,
879 .default_value = "false",
880 .value = &settings.per_monitor_dpi,
881 .parser = string_parse_bool,
882 .parser_data = boolean_enum_data,
883 },
884 {
885 .name = "force_xinerama",
886 .section = "global",
887 .description = "Force the use of the Xinerama extension",
888 .type = TYPE_CUSTOM,
889 .default_value = "false",
890 .value = &settings.force_xinerama,
891 .parser = string_parse_bool,
892 .parser_data = boolean_enum_data,
893 },
894 {
895 .name = "force_xwayland",
896 .section = "global",
897 .description = "Force the use of the xwayland output",
898 .type = TYPE_CUSTOM,
899 .default_value = "false",
900 .value = &settings.force_xwayland,
901 .parser = string_parse_bool,
902 .parser_data = boolean_enum_data,
903 },
904 {
905 .name = "font",
906 .section = "global",
907 .description = "The font dunst should use.",
908 .type = TYPE_STRING,
909 .default_value = "Monospace 8",
910 .value = &settings.font,
911 .parser = NULL,
912 .parser_data = NULL,
913 },
914 {
915 .name = "sort",
916 .section = "global",
917 .description = "Sort type by id/urgency/update",
918 .type = TYPE_CUSTOM,
919 .default_value = "true",
920 .value = &settings.sort,
921 .parser = string_parse_enum,
922 .parser_data = sort_type_enum_data,
923 },
924 {
925 .name = "indicate_hidden",
926 .section = "global",
927 .description = "Show how many notifications are hidden",
928 .type = TYPE_CUSTOM,
929 .default_value = "true",
930 .value = &settings.indicate_hidden,
931 .parser = string_parse_enum,
932 .parser_data = boolean_enum_data,
933 },
934 {
935 .name = "ignore_dbusclose",
936 .section = "global",
937 .description = "Ignore dbus CloseNotification events",
938 .type = TYPE_CUSTOM,
939 .default_value = "false",
940 .value = &settings.ignore_dbusclose,
941 .parser = string_parse_enum,
942 .parser_data = boolean_enum_data,
943 },
944 {
945 .name = "ignore_newline",
946 .section = "global",
947 .description = "Ignore newline characters in notifications",
948 .type = TYPE_CUSTOM,
949 .default_value = "false",
950 .value = &settings.ignore_newline,
951 .parser = string_parse_enum,
952 .parser_data = boolean_enum_data,
953 },
954 {
955 .name = "idle_threshold",
956 .section = "global",
957 .description = "Don't timeout notifications if user is longer idle than threshold",
958 .type = TYPE_TIME,
959 .default_value = "0",
960 .value = &settings.idle_threshold,
961 .parser = NULL,
962 .parser_data = NULL,
963 },
964 {
965 .name = "monitor",
966 .section = "global",
967 .description = "On which monitor should the notifications be displayed",
968 .type = TYPE_CUSTOM,
969 .default_value = "0",
970 .value = &settings.monitor,
971 .parser = string_parse_maybe_int,
972 .parser_data = &settings.monitor_num,
973 },
974 {
975 .name = "title",
976 .section = "global",
977 .description = "Define the title of windows spawned by dunst.",
978 .type = TYPE_STRING,
979 .default_value = "Dunst",
980 .value = &settings.title,
981 .parser = NULL,
982 .parser_data = NULL,
983 },
984 {
985 .name = "class",
986 .section = "global",
987 .description = "Define the class of windows spawned by dunst.",
988 .type = TYPE_STRING,
989 .default_value = "Dunst",
990 .value = &settings.class,
991 .parser = NULL,
992 .parser_data = NULL,
993 },
994 {
995 .name = "shrink",
996 .section = "global",
997 .description = "Shrink window if it's smaller than the width",
998 .type = TYPE_CUSTOM,
999 .default_value = "false",
1000 .value = &settings.shrink,
1001 .parser = string_parse_enum,
1002 .parser_data = boolean_enum_data,
1003 },
1004 {
1005 .name = "line_height",
1006 .section = "global",
1007 .description = "Add spacing between lines of text",
1008 .type = TYPE_INT,
1009 .default_value = "0",
1010 .value = &settings.line_height,
1011 .parser = NULL,
1012 .parser_data = NULL,
1013 },
1014 {
1015 .name = "show_age_threshold",
1016 .section = "global",
1017 .description = "When should the age of the notification be displayed?",
1018 .type = TYPE_TIME,
1019 .default_value = "60",
1020 .value = &settings.show_age_threshold,
1021 .parser = NULL,
1022 .parser_data = NULL,
1023 },
1024 {
1025 .name = "hide_duplicate_count",
1026 .section = "global",
1027 .description = "Hide the count of stacked notifications with the same content",
1028 .type = TYPE_CUSTOM,
1029 .default_value = "false",
1030 .value = &settings.hide_duplicate_count,
1031 .parser = string_parse_bool,
1032 .parser_data = boolean_enum_data,
1033 },
1034 {
1035 .name = "sticky_history",
1036 .section = "global",
1037 .description = "Don't timeout notifications popped up from history",
1038 .type = TYPE_CUSTOM,
1039 .default_value = "true",
1040 .value = &settings.sticky_history,
1041 .parser = string_parse_enum,
1042 .parser_data = boolean_enum_data,
1043 },
1044 {
1045 .name = "history_length",
1046 .section = "global",
1047 .description = "Max amount of notifications kept in history",
1048 .type = TYPE_INT,
1049 .default_value = "20",
1050 .value = &settings.history_length,
1051 .parser = NULL,
1052 .parser_data = NULL,
1053 },
1054 {
1055 .name = "show_indicators",
1056 .section = "global",
1057 .description = "Show indicators for actions \"(A)\" and URLs \"(U)\"",
1058 .type = TYPE_CUSTOM,
1059 .default_value = "true",
1060 .value = &settings.show_indicators,
1061 .parser = string_parse_enum,
1062 .parser_data = boolean_enum_data,
1063 },
1064 {
1065 .name = "separator_height",
1066 .section = "global",
1067 .description = "height of the separator line",
1068 .type = TYPE_INT,
1069 .default_value = "2",
1070 .value = &settings.separator_height,
1071 .parser = NULL,
1072 .parser_data = NULL,
1073 },
1074 {
1075 .name = "padding",
1076 .section = "global",
1077 .description = "Padding between text and separator",
1078 .type = TYPE_INT,
1079 .default_value = "8",
1080 .value = &settings.padding,
1081 .parser = NULL,
1082 .parser_data = NULL,
1083 },
1084 {
1085 .name = "horizontal_padding",
1086 .section = "global",
1087 .description = "horizontal padding",
1088 .type = TYPE_INT,
1089 .default_value = "8",
1090 .value = &settings.h_padding,
1091 .parser = NULL,
1092 .parser_data = NULL,
1093 },
1094 {
1095 .name = "text_icon_padding",
1096 .section = "global",
1097 .description = "Padding between text and icon",
1098 .type = TYPE_INT,
1099 .default_value = "0",
1100 .value = &settings.text_icon_padding,
1101 .parser = NULL,
1102 .parser_data = NULL,
1103 },
1104 {
1105 .name = "transparency",
1106 .section = "global",
1107 .description = "Transparency. Range 0-100",
1108 .type = TYPE_INT,
1109 .default_value = "0",
1110 .value = &settings.transparency,
1111 .parser = NULL,
1112 .parser_data = NULL,
1113 },
1114 {
1115 .name = "corner_radius",
1116 .section = "global",
1117 .description = "Window corner radius",
1118 .type = TYPE_INT,
1119 .default_value = "0",
1120 .value = &settings.corner_radius,
1121 .parser = NULL,
1122 .parser_data = NULL,
1123 },
1124 {
1125 .name = "progress_bar_height",
1126 .section = "global",
1127 .description = "Height of the progress bar",
1128 .type = TYPE_INT,
1129 .default_value = "10",
1130 .value = &settings.progress_bar_height,
1131 .parser = NULL,
1132 .parser_data = NULL,
1133 },
1134 {
1135 .name = "progress_bar_min_width",
1136 .section = "global",
1137 .description = "Minimum width of the progress bar",
1138 .type = TYPE_INT,
1139 .default_value = "150",
1140 .value = &settings.progress_bar_min_width,
1141 .parser = NULL,
1142 .parser_data = NULL,
1143 },
1144 {
1145 .name = "progress_bar_max_width",
1146 .section = "global",
1147 .description = "Maximum width of the progress bar",
1148 .type = TYPE_INT,
1149 .default_value = "300",
1150 .value = &settings.progress_bar_max_width,
1151 .parser = NULL,
1152 .parser_data = NULL,
1153 },
1154 {
1155 .name = "progress_bar_frame_width",
1156 .section = "global",
1157 .description = "Frame width of the progress bar",
1158 .type = TYPE_INT,
1159 .default_value = "1",
1160 .value = &settings.progress_bar_frame_width,
1161 .parser = NULL,
1162 .parser_data = NULL,
1163 },
1164 {
1165 .name = "progress_bar_corner_radius",
1166 .section = "global",
1167 .description = "Progress bar corner radius",
1168 .type = TYPE_INT,
1169 .default_value = "0",
1170 .value = &settings.progress_bar_corner_radius,
1171 .parser = NULL,
1172 .parser_data = NULL,
1173 },
1174 {
1175 .name = "icon_corner_radius",
1176 .section = "global",
1177 .description = "Icon corner radius",
1178 .type = TYPE_INT,
1179 .default_value = "0",
1180 .value = &settings.icon_corner_radius,
1181 .parser = NULL,
1182 .parser_data = NULL,
1183 },
1184 {
1185 .name = "progress_bar",
1186 .section = "global",
1187 .description = "Show the progress bar",
1188 .type = TYPE_CUSTOM,
1189 .default_value = "true",
1190 .value = &settings.progress_bar,
1191 .parser = string_parse_bool,
1192 .parser_data = boolean_enum_data,
1193 },
1194 {
1195 .name = "stack_duplicates",
1196 .section = "global",
1197 .description = "Stack together notifications with the same content",
1198 .type = TYPE_CUSTOM,
1199 .default_value = "true",
1200 .value = &settings.stack_duplicates,
1201 .parser = string_parse_bool,
1202 .parser_data = boolean_enum_data,
1203 },
1204 {
1205 .name = "dmenu",
1206 .section = "global",
1207 .description = "path to dmenu",
1208 .type = TYPE_PATH,
1209 .default_value = "/usr/bin/dmenu -p dunst",
1210 .value = &settings.dmenu,
1211 .parser = NULL,
1212 .parser_data = &settings.dmenu_cmd,
1213 },
1214 {
1215 .name = "browser",
1216 .section = "global",
1217 .description = "path to browser",
1218 .type = TYPE_PATH,
1219 .default_value = "/usr/bin/xdg-open",
1220 .value = &settings.browser,
1221 .parser = NULL,
1222 .parser_data = &settings.browser_cmd,
1223 },
1224 {
1225 .name = "always_run_script",
1226 .section = "global",
1227 .description = "Always run rule-defined scripts, even if the notification is suppressed with format = \"\".",
1228 .type = TYPE_CUSTOM,
1229 .default_value = "true",
1230 .value = &settings.always_run_script,
1231 .parser = string_parse_bool,
1232 .parser_data = boolean_enum_data,
1233 },
1234 {
1235 .name = "gap_size",
1236 .section = "global",
1237 .description = "Size of gap between notifications",
1238 .type = TYPE_INT,
1239 .default_value = "0",
1240 .value = &settings.gap_size,
1241 .parser = NULL,
1242 .parser_data = NULL,
1243 },
1244 {
1245 .name = "default_pause_level",
1246 .section = "global",
1247 .description = "Start dunst with a this pause level set.",
1248 .type = TYPE_INT,
1249 .default_value = "0",
1250 .value = &settings.default_pause_level,
1251 .parser = NULL,
1252 .parser_data = NULL,
1253 },
1254 {
1255 .name = "pause_on_mouse_over",
1256 .section = "experimental",
1257 .description = "Pause notification timeout when mouse is over the notification window. Only works on Wayland.",
1258 .type = TYPE_CUSTOM,
1259 .default_value = "false",
1260 .value = &settings.pause_on_mouse_over,
1261 .parser = string_parse_bool,
1262 .parser_data = boolean_enum_data,
1263 },
1264 // manual extractions below
1265 {
1266 .name = "follow",
1267 .section = "global",
1268 .description = "Follow mouse, keyboard or none?",
1269 .type = TYPE_CUSTOM,
1270 .default_value = "none",
1271 .value = &settings.f_mode,
1272 .parser = string_parse_enum,
1273 .parser_data = follow_mode_enum_data,
1274 },
1275 {
1276 .name = "scale",
1277 .section = "global",
1278 .description = "Scale factor, set to 0 to auto-detect, X11 only",
1279 .type = TYPE_DOUBLE,
1280 .default_value = "0",
1281 .value = &settings.scale,
1282 .parser = NULL,
1283 .parser_data = NULL,
1284 },
1285 {
1286 .name = "separator_color",
1287 .section = "global",
1288 .description = "Color of the separator line (or 'auto')",
1289 .type = TYPE_CUSTOM,
1290 .default_value = "frame",
1291 .value = &settings.sep_color,
1292 .parser = string_parse_sepcolor,
1293 .parser_data = sep_color_enum_data,
1294 },
1295 {
1296 .name = "vertical_alignment",
1297 .section = "global",
1298 .description = "Align icon and text top/center/bottom",
1299 .type = TYPE_CUSTOM,
1300 .default_value = "center",
1301 .value = &settings.vertical_alignment,
1302 .parser = string_parse_enum,
1303 .parser_data = vertical_alignment_enum_data,
1304 },
1305 {
1306 .name = "layer",
1307 .section = "global",
1308 .description = "Select the layer where notifications should be placed",
1309 .type = TYPE_CUSTOM,
1310 .default_value = "overlay",
1311 .value = &settings.layer,
1312 .parser = string_parse_enum,
1313 .parser_data = layer_enum_data,
1314 },
1315 {
1316 .name = "mouse_left_click",
1317 .section = "global",
1318 .description = "Action of left click event",
1319 .type = TYPE_LIST,
1320 .default_value = "close_current",
1321 .value = &settings.mouse_left_click,
1322 .parser = NULL,
1323 .parser_data = GINT_TO_POINTER(MOUSE_LIST),
1324 },
1325 {
1326 .name = "mouse_middle_click",
1327 .section = "global",
1328 .description = "Action of middle click event",
1329 .type = TYPE_LIST,
1330 .default_value = "do_action, remove_current",
1331 .value = &settings.mouse_middle_click,
1332 .parser = NULL,
1333 .parser_data = GINT_TO_POINTER(MOUSE_LIST),
1334 },
1335 {
1336 .name = "mouse_right_click",
1337 .section = "global",
1338 .description = "Action of right click event",
1339 .type = TYPE_LIST,
1340 .default_value = "close_all",
1341 .value = &settings.mouse_right_click,
1342 .parser = NULL,
1343 .parser_data = GINT_TO_POINTER(MOUSE_LIST),
1344 },
1345 {
1346 .name = "icon_theme",
1347 .section = "global",
1348 .description = "Name of the icon theme",
1349 .type = TYPE_LIST,
1350 .default_value = "Adwaita",
1351 .value = &settings.icon_theme,
1352 .parser = NULL,
1353 .parser_data = GINT_TO_POINTER(STRING_LIST),
1354 },
1355 {
1356 .name = "icon_path",
1357 .section = "global",
1358 .description = "paths to default icons",
1359 .type = TYPE_STRING,
1360 .default_value = "/usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/",
1361 .value = &settings.icon_path,
1362 .parser = NULL,
1363 .parser_data = NULL,
1364 },
1365 {
1366 .name = "enable_recursive_icon_lookup",
1367 .section = "global",
1368 .description = "Name of the icon theme",
1369 .type = TYPE_CUSTOM,
1370 .default_value = "false",
1371 .value = &settings.enable_recursive_icon_lookup,
1372 .parser = string_parse_bool,
1373 .parser_data = boolean_enum_data,
1374 .different_default = true,
1375 },
1376 {
1377 .name = "enable_posix_regex",
1378 .section = "global",
1379 .description = "Enable POSIX regex for filtering rules",
1380 .type = TYPE_CUSTOM,
1381 .default_value = "false",
1382 .value = &settings.enable_regex,
1383 .parser = string_parse_bool,
1384 .parser_data = boolean_enum_data,
1385 },
1386 {
1387 .name = "frame_width",
1388 .section = "global",
1389 .description = "Width of frame around the window",
1390 .type = TYPE_INT,
1391 .default_value = "3",
1392 .value = &settings.frame_width,
1393 .parser = NULL,
1394 .parser_data = NULL,
1395 },
1396
1397 // These are only used for setting defaults, since there is a rule
1398 // above doing the same.
1399 // TODO it's probably better to create an array with default rules.
1400 {
1401 .name = "background",
1402 .section = "urgency_low",
1403 .description = "Background color for notifications with low urgency",
1404 .type = TYPE_COLOR,
1405 .default_value = "#222222",
1406 .value = &settings.colors_low.bg,
1407 .parser = NULL,
1408 .parser_data = NULL,
1409 },
1410 {
1411 .name = "foreground",
1412 .section = "urgency_low",
1413 .description = "Foreground color for notifications with low urgency",
1414 .type = TYPE_COLOR,
1415 .default_value = "#888888",
1416 .value = &settings.colors_low.fg,
1417 .parser = NULL,
1418 .parser_data = NULL,
1419 },
1420 {
1421 .name = "highlight",
1422 .section = "urgency_low",
1423 .description = "Highlight color for notifications with low urgency",
1424 .type = TYPE_GRADIENT,
1425 .default_value = "#7f7fff",
1426 .value = &settings.colors_low.highlight,
1427 .parser = NULL,
1428 .parser_data = NULL,
1429 },
1430 {
1431 .name = "frame_color",
1432 .section = "urgency_low",
1433 .description = "Frame color for notifications with low urgency",
1434 .type = TYPE_COLOR,
1435 .default_value = "#888888",
1436 .value = &settings.colors_low.frame,
1437 .parser = NULL,
1438 .parser_data = NULL,
1439 },
1440 {
1441 .name = "timeout",
1442 .section = "urgency_low",
1443 .description = "Timeout for notifications with low urgency",
1444 .type = TYPE_TIME,
1445 .default_value = "10", // in seconds
1446 .value = &settings.timeouts[URG_LOW],
1447 .parser = NULL,
1448 .parser_data = NULL,
1449 },
1450 {
1451 .name = "background",
1452 .section = "urgency_normal",
1453 .description = "Background color for notifications with normal urgency",
1454 .type = TYPE_COLOR,
1455 .default_value = "#285577",
1456 .value = &settings.colors_norm.bg,
1457 .parser = NULL,
1458 .parser_data = NULL,
1459 },
1460 {
1461 .name = "foreground",
1462 .section = "urgency_normal",
1463 .description = "Foreground color for notifications with normal urgency",
1464 .type = TYPE_COLOR,
1465 .default_value = "#ffffff",
1466 .value = &settings.colors_norm.fg,
1467 .parser = NULL,
1468 .parser_data = NULL,
1469 },
1470 {
1471 .name = "highlight",
1472 .section = "urgency_normal",
1473 .description = "Highlight color for notifications with normal urgency",
1474 .type = TYPE_GRADIENT,
1475 .default_value = "#1745d1",
1476 .value = &settings.colors_norm.highlight,
1477 .parser = NULL,
1478 .parser_data = NULL,
1479 },
1480 {
1481 .name = "frame_color",
1482 .section = "urgency_normal",
1483 .description = "Frame color for notifications with normal urgency",
1484 .type = TYPE_COLOR,
1485 .default_value = "#888888",
1486 .value = &settings.colors_norm.frame,
1487 .parser = NULL,
1488 .parser_data = NULL,
1489 },
1490 {
1491 .name = "timeout",
1492 .section = "urgency_normal",
1493 .description = "Timeout for notifications with normal urgency",
1494 .type = TYPE_TIME,
1495 .default_value = "10",
1496 .value = &settings.timeouts[URG_NORM],
1497 .parser = NULL,
1498 .parser_data = NULL,
1499 },
1500 {
1501 .name = "background",
1502 .section = "urgency_critical",
1503 .description = "Background color for notifications with critical urgency",
1504 .type = TYPE_COLOR,
1505 .default_value = "#900000",
1506 .value = &settings.colors_crit.bg,
1507 .parser = NULL,
1508 .parser_data = NULL,
1509 },
1510 {
1511 .name = "foreground",
1512 .section = "urgency_critical",
1513 .description = "Foreground color for notifications with ciritical urgency",
1514 .type = TYPE_COLOR,
1515 .default_value = "#ffffff",
1516 .value = &settings.colors_crit.fg,
1517 .parser = NULL,
1518 .parser_data = NULL,
1519 },
1520 {
1521 .name = "highlight",
1522 .section = "urgency_critical",
1523 .description = "Highlight color for notifications with ciritical urgency",
1524 .type = TYPE_GRADIENT,
1525 .default_value = "#ff6666",
1526 .value = &settings.colors_crit.highlight,
1527 .parser = NULL,
1528 .parser_data = NULL,
1529 },
1530 {
1531 .name = "frame_color",
1532 .section = "urgency_critical",
1533 .description = "Frame color for notifications with critical urgency",
1534 .type = TYPE_COLOR,
1535 .default_value = "#ff0000",
1536 .value = &settings.colors_crit.frame,
1537 .parser = NULL,
1538 .parser_data = NULL,
1539 },
1540 {
1541 .name = "timeout",
1542 .section = "urgency_critical",
1543 .description = "Timeout for notifications with critical urgency",
1544 .type = TYPE_TIME,
1545 .default_value = "0",
1546 .value = &settings.timeouts[URG_CRIT],
1547 .parser = NULL,
1548 .parser_data = NULL,
1549 },
1550 {
1551 .name = "origin",
1552 .section = "global",
1553 .description = "Specifies the where the notification is positioned before offsetting.",
1554 .type = TYPE_CUSTOM,
1555 .default_value = "top-right",
1556 .value = &settings.origin,
1557 .parser = string_parse_enum,
1558 .parser_data = origin_enum_data,
1559 },
1560 {
1561 .name = "width",
1562 .section = "global",
1563 .description = "The width of the notification, excluding the frame.",
1564 .type = TYPE_LENGTH,
1565 .default_value = "300",
1566 .value = &settings.width,
1567 .parser = NULL,
1568 .parser_data = NULL,
1569 },
1570 {
1571 .name = "height",
1572 .section = "global",
1573 .description = "The height of a notification, excluding the frame.",
1574 .type = TYPE_LENGTH,
1575 .default_value = "(0, 300)",
1576 .value = &settings.height,
1577 .parser = NULL,
1578 .parser_data = NULL,
1579 },
1580 {
1581 .name = "offset",
1582 .section = "global",
1583 .description = "The offset of the notification from the origin.",
1584 .type = TYPE_LENGTH,
1585 .default_value = "(10, 50)",
1586 .value = &settings.offset,
1587 .parser = NULL,
1588 .parser_data = NULL,
1589 },
1590 {
1591 .name = "notification_limit",
1592 .section = "global",
1593 .description = "Maximum number of notifications allowed",
1594 .type = TYPE_INT,
1595 .default_value = "20",
1596 .value = &settings.notification_limit,
1597 .parser = NULL,
1598 .parser_data = NULL,
1599 },
1600
1601 // Keyboard shortcuts (still in global section)
1602 {
1603 .name = "close",
1604 .section = "global",
1605 .description = "Shortcut for closing one notification",
1606 .type = TYPE_STRING,
1607 .default_value = "none",
1608 .value = &settings.close_ks.str,
1609 .parser = NULL,
1610 .parser_data = NULL,
1611 },
1612 {
1613 .name = "close_all",
1614 .section = "global",
1615 .description = "Shortcut for closing all notifications",
1616 .type = TYPE_STRING,
1617 .default_value = "none",
1618 .value = &settings.close_all_ks.str,
1619 .parser = NULL,
1620 .parser_data = NULL,
1621 },
1622 {
1623 .name = "history",
1624 .section = "global",
1625 .description = "Shortcut to pop the last notification from history",
1626 .type = TYPE_STRING,
1627 .default_value = "none",
1628 .value = &settings.history_ks.str,
1629 .parser = NULL,
1630 .parser_data = NULL,
1631 },
1632 {
1633 .name = "context",
1634 .section = "global",
1635 .description = "Shortcut for context menu",
1636 .type = TYPE_STRING,
1637 .default_value = "none",
1638 .value = &settings.context_ks.str,
1639 .parser = NULL,
1640 .parser_data = NULL,
1641 },
1642};
1643
1644#endif
urgency
Representing the urgencies according to the notification spec.
@ URG_NONE
Urgency not set (invalid)
@ URG_NORM
Normal urgency.
@ URG_CRIT
Critical urgency.
@ URG_LOW
Low urgency.
@ FS_SHOW
Show the message when in fullscreen mode.
@ FS_PUSHBACK
When entering fullscreen mode, push the notification back to waiting.
@ FS_DELAY
Delay the notification until leaving fullscreen mode.
@ FS_NULL
Invalid value.
int string_parse_maybe_int(const void *data, const char *s, void *ret)
Parse a string that may represent an integer value.
Parser for settings and cmdline arguments.
Rules managment and helpers.
Type definitions for settings.
Definition rules.h:20
void * value
(nullable) A pointer to the corresponding setting in the setting struct.
char * section
A string with the ini section where the variable is allowed.
char * name
A string with the setting key as found in the config file.
char * default_value
A string with the default value of the setting.
enum setting_type type
Enum of the setting type.
const void * parser_data
(nullable) A pointer to the data required for the parser to parse this setting.
size_t rule_offset
The offset of this setting in the rule struct, if it exists.
char * description
A string with a short description of the config variable.
bool different_default
True if a setting has a different default in the default dunstrc.
int(* parser)(const void *data, const char *cfg_value, void *ret)
(nullable) Function pointer for the parser - to be used in case of enums or other special settings.
struct position offset
Definition settings.h:189