summaryrefslogtreecommitdiffstats
path: root/include/bar/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/bar/config.h')
-rw-r--r--include/bar/config.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/bar/config.h b/include/bar/config.h
new file mode 100644
index 00000000..508b9c42
--- /dev/null
+++ b/include/bar/config.h
@@ -0,0 +1,69 @@
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 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 height;
30
31 struct {
32 uint32_t background;
33 uint32_t statusline;
34 uint32_t separator;
35
36 struct box_colors focused_workspace;
37 struct box_colors active_workspace;
38 struct box_colors inactive_workspace;
39 struct box_colors urgent_workspace;
40 struct box_colors binding_mode;
41 } colors;
42};
43
44/**
45 * Parse colors defined as hex string to uint32_t.
46 */
47uint32_t parse_color(const char *color);
48
49/**
50 * Parse position top|bottom|left|right.
51 */
52uint32_t parse_position(const char *position);
53
54/**
55 * Parse font.
56 */
57char *parse_font(const char *font);
58
59/**
60 * Initialize default sway config.
61 */
62struct config *init_config();
63
64/**
65 * Free config struct.
66 */
67void free_config(struct config *config);
68
69#endif /* _SWAYBAR_CONFIG_H */