Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
settings.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
10
11#ifndef DUNST_SETTINGS_H
12#define DUNST_SETTINGS_H
13
14#include <stdbool.h>
15
16#ifdef ENABLE_WAYLAND
17#include "wayland/protocols/wlr-layer-shell-unstable-v1-client-header.h"
18#endif
19
20#ifdef ENABLE_X11
21#include "x11/x.h"
22#endif
23
28 char *str;
29#ifdef ENABLE_X11
30 KeyCode code;
31 KeySym sym;
32 KeySym mask;
33 bool is_valid;
34#endif
35};
36
37#include "notification.h"
38#include "draw.h"
39
40#define LIST_END (-1)
41
42enum alignment { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT };
43enum sort_type { SORT_TYPE_ID, SORT_TYPE_URGENCY_ASCENDING, SORT_TYPE_URGENCY_DESCENDING, SORT_TYPE_UPDATE };
44enum vertical_alignment { VERTICAL_TOP, VERTICAL_CENTER, VERTICAL_BOTTOM };
45enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM };
46enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD };
47enum mouse_action { MOUSE_NONE, MOUSE_DO_ACTION, MOUSE_CLOSE_CURRENT, MOUSE_REMOVE_CURRENT,
48 MOUSE_CLOSE_ALL, MOUSE_CONTEXT, MOUSE_CONTEXT_ALL, MOUSE_OPEN_URL,
49 MOUSE_ACTION_END = LIST_END /* indicates the end of a list of mouse actions */};
50#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM
51#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM
52// Needed for compiling without wayland dependency
53enum zwlr_layer_shell_v1_layer {
54 ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0,
55 ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1,
56 ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2,
57 ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3,
58};
59#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */
60
61#ifndef ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
62#define ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
81#endif /* ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM */
82
83enum origin_values {
85 ORIGIN_TOP_CENTER = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP,
88 ORIGIN_BOTTOM_CENTER = ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM,
90 ORIGIN_LEFT_CENTER = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT,
91 ORIGIN_RIGHT_CENTER = ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT,
92 ORIGIN_CENTER = 0,
93};
94
95// TODO make a TYPE_CMD, instead of using TYPE_PATH for settings like dmenu and browser
96enum setting_type { TYPE_MIN = 0, TYPE_INT, TYPE_DOUBLE, TYPE_STRING,
97 TYPE_PATH, TYPE_TIME, TYPE_LIST, TYPE_CUSTOM, TYPE_LENGTH, TYPE_COLOR,
98 TYPE_GRADIENT, TYPE_DEPRECATED, TYPE_MAX = TYPE_DEPRECATED + 1 }; // to be implemented
99
101 enum separator_color type;
102 struct color color;
103};
104
105struct length {
106 int min;
107 int max;
108};
109
110struct position {
111 int x;
112 int y;
113};
114
115struct settings {
116 bool print_notifications;
117 bool per_monitor_dpi;
118 bool stack_duplicates;
119 bool hide_duplicate_count;
120 char *font;
121 struct notification_colors colors_low;
122 struct notification_colors colors_norm;
123 struct notification_colors colors_crit;
124 char *format;
125 gint64 timeouts[3];
126 char *icons[3];
127 unsigned int transparency;
128 char *title;
129 char *class;
130 int shrink;
131 enum sort_type sort;
132 int indicate_hidden;
133 gint64 idle_threshold;
134 gint64 show_age_threshold;
135 enum alignment align;
136 int sticky_history;
137 int history_length;
138 int show_indicators;
139 int ignore_dbusclose;
140 int ignore_newline;
141 int line_height;
142 int separator_height;
143 int padding;
144 int h_padding;
145 int text_icon_padding;
146 struct separator_color_data sep_color;
147 int frame_width;
148 struct color frame_color;
149 int startup_notification;
150 char *monitor;
151 int monitor_num;
152 double scale;
153 char *dmenu;
154 char **dmenu_cmd;
155 char *browser;
156 char **browser_cmd;
157 enum vertical_alignment vertical_alignment;
158 char **icon_theme; // experimental
159 bool enable_recursive_icon_lookup; // experimental
160 bool enable_regex; // experimental
161 char *icon_path;
162 enum follow_mode f_mode;
163 bool always_run_script;
164 struct keyboard_shortcut close_ks;
165 struct keyboard_shortcut close_all_ks;
166 struct keyboard_shortcut history_ks;
167 struct keyboard_shortcut context_ks;
168 bool force_xinerama;
169 bool force_xwayland;
170 int corner_radius;
171 enum mouse_action *mouse_left_click;
172 enum mouse_action *mouse_middle_click;
173 enum mouse_action *mouse_right_click;
174 int progress_bar_height;
175 int progress_bar_min_width;
176 int progress_bar_max_width;
177 int progress_bar_frame_width;
178 int progress_bar_corner_radius;
179 int icon_corner_radius;
180 enum corner_pos corners;
181 enum corner_pos icon_corners;
182 enum corner_pos progress_bar_corners;
183 bool progress_bar;
184 enum zwlr_layer_shell_v1_layer layer;
185 enum origin_values origin;
186 struct length width;
187 struct length height;
190 int notification_limit;
191 int gap_size;
192 int default_pause_level;
193 bool pause_on_mouse_over;
194};
195
196extern struct settings settings;
197extern bool print_notifications;
198
199void load_settings(char **const config_paths);
200
201void settings_free(struct settings *s);
202
203#endif
Layout and render notifications.
corner_pos
Specify which corner to draw in draw_rouned_rect.
Definition draw.h:28
Notification type definitions.
zwlr_layer_surface_v1_anchor
Definition settings.h:63
@ ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM
the bottom edge of the anchor rectangle
Definition settings.h:71
@ ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT
the left edge of the anchor rectangle
Definition settings.h:75
@ ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT
the right edge of the anchor rectangle
Definition settings.h:79
@ ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
the top edge of the anchor rectangle
Definition settings.h:67
Definition draw.h:48
struct position offset
Definition settings.h:189
Xorg output wrapper.