summaryrefslogtreecommitdiffstats
path: root/swaybar/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/config.h')
-rw-r--r--swaybar/config.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/swaybar/config.h b/swaybar/config.h
new file mode 100644
index 00000000..5cda97e6
--- /dev/null
+++ b/swaybar/config.h
@@ -0,0 +1,73 @@
1#ifndef _SWAYBAR_CONFIG_H
2#define _SWAYBAR_CONFIG_H
3
4#include <stdint.h>
5#include <stdbool.h>
6
7/**
8 * Colors for a box with background, border and text colors.
9 */
10struct box_colors {
11 uint32_t border;
12 uint32_t background;
13 uint32_t text;
14};
15
16/**
17 * Swaybar config.
18 */
19struct swaybar_config {
20 char *status_command;
21 uint32_t position;
22 char *font;
23 char *sep_symbol;
24 char *mode;
25 bool strip_workspace_numbers;
26 bool binding_mode_indicator;
27 bool workspace_buttons;
28
29 int margin;
30 int ws_horizontal_padding;
31 double ws_vertical_padding;
32 int ws_spacing;
33 int text_height;
34
35 struct {
36 uint32_t background;
37 uint32_t statusline;
38 uint32_t separator;
39
40 struct box_colors focused_workspace;
41 struct box_colors active_workspace;
42 struct box_colors inactive_workspace;
43 struct box_colors urgent_workspace;
44 struct box_colors binding_mode;
45 } colors;
46};
47
48/**
49 * Parse colors defined as hex string to uint32_t.
50 */
51uint32_t parse_color(const char *color);
52
53/**
54 * Parse position top|bottom|left|right.
55 */
56uint32_t parse_position(const char *position);
57
58/**
59 * Parse font.
60 */
61char *parse_font(const char *font);
62
63/**
64 * Initialize default sway config.
65 */
66struct swaybar_config *init_config();
67
68/**
69 * Free config struct.
70 */
71void free_config(struct swaybar_config *config);
72
73#endif /* _SWAYBAR_CONFIG_H */