1 /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
2 #ifndef DUNST_SETTINGS_H
3 #define DUNST_SETTINGS_H
4 
5 #include <stdbool.h>
6 
7 #ifdef ENABLE_WAYLAND
8 #include "wayland/protocols/wlr-layer-shell-unstable-v1-client-header.h"
9 #endif
10 
11 #include "markup.h"
12 #include "notification.h"
13 #include "x11/x.h"
14 
15 enum alignment { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT };
16 enum ellipsize { ELLIPSE_START, ELLIPSE_MIDDLE, ELLIPSE_END };
17 enum icon_position { ICON_LEFT, ICON_RIGHT, ICON_OFF };
18 enum vertical_alignment { VERTICAL_TOP, VERTICAL_CENTER, VERTICAL_BOTTOM };
19 enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM };
20 enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD };
21 enum mouse_action { MOUSE_NONE, MOUSE_DO_ACTION, MOUSE_CLOSE_CURRENT, MOUSE_CLOSE_ALL };
22 #ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM
23 #define ZWLR_LAYER_SHELL_V1_LAYER_ENUM
24 // Needed for compiling without wayland dependency
25 enum zwlr_layer_shell_v1_layer {
26 	ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0,
27 	ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1,
28 	ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2,
29 	ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3,
30 };
31 #endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */
32 
33 struct separator_color_data {
34         enum separator_color type;
35         char *sep_color;
36 };
37 
38 struct geometry {
39         int x;
40         int y;
41         unsigned int w;
42         unsigned int h;
43         bool negative_x;
44         bool negative_y;
45         bool negative_width;
46         bool width_set;
47 };
48 
49 struct settings {
50         bool print_notifications;
51         bool per_monitor_dpi;
52         enum markup_mode markup;
53         bool stack_duplicates;
54         bool hide_duplicate_count;
55         char *font;
56         struct notification_colors colors_low;
57         struct notification_colors colors_norm;
58         struct notification_colors colors_crit;
59         char *format;
60         gint64 timeouts[3];
61         char *icons[3];
62         unsigned int transparency;
63         struct geometry geometry;
64         char *title;
65         char *class;
66         int shrink;
67         int sort;
68         int indicate_hidden;
69         gint64 idle_threshold;
70         gint64 show_age_threshold;
71         enum alignment align;
72         int sticky_history;
73         int history_length;
74         int show_indicators;
75         int word_wrap;
76         int ignore_dbusclose;
77         enum ellipsize ellipsize;
78         int ignore_newline;
79         int line_height;
80         int notification_height;
81         int separator_height;
82         int padding;
83         int h_padding;
84         int text_icon_padding;
85         struct separator_color_data sep_color;
86         int frame_width;
87         char *frame_color;
88         int startup_notification;
89         int monitor;
90         char *dmenu;
91         char **dmenu_cmd;
92         char *browser;
93         char **browser_cmd;
94         enum icon_position icon_position;
95         enum vertical_alignment vertical_alignment;
96         int min_icon_size;
97         int max_icon_size;
98         char *icon_path;
99         enum follow_mode f_mode;
100         bool always_run_script;
101         struct keyboard_shortcut close_ks;
102         struct keyboard_shortcut close_all_ks;
103         struct keyboard_shortcut history_ks;
104         struct keyboard_shortcut context_ks;
105         bool force_xinerama;
106         bool force_xwayland;
107         int corner_radius;
108         enum mouse_action *mouse_left_click;
109         enum mouse_action *mouse_middle_click;
110         enum mouse_action *mouse_right_click;
111         int progress_bar_height;
112         int progress_bar_min_width;
113         int progress_bar_max_width;
114         int progress_bar_frame_width;
115         bool progress_bar;
116         enum zwlr_layer_shell_v1_layer layer;
117 };
118 
119 extern struct settings settings;
120 
121 void load_settings(char *cmdline_config_path);
122 
123 #endif
124 /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */
125