diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-23 02:47:44 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-24 14:22:17 +0100 |
commit | bb986cb33637147663c115c8b8f8bdff170f23a8 (patch) | |
tree | 34ca3a44732114013e7357d7cd894941ea1b95be /swaybar/config.h | |
parent | numlen(0) == 1 (diff) | |
download | sway-bb986cb33637147663c115c8b8f8bdff170f23a8.tar.gz sway-bb986cb33637147663c115c8b8f8bdff170f23a8.tar.zst sway-bb986cb33637147663c115c8b8f8bdff170f23a8.zip |
swaybar: Separate config
Diffstat (limited to 'swaybar/config.h')
-rw-r--r-- | swaybar/config.h | 73 |
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 | */ | ||
10 | struct box_colors { | ||
11 | uint32_t border; | ||
12 | uint32_t background; | ||
13 | uint32_t text; | ||
14 | }; | ||
15 | |||
16 | /** | ||
17 | * Swaybar config. | ||
18 | */ | ||
19 | struct 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 | */ | ||
51 | uint32_t parse_color(const char *color); | ||
52 | |||
53 | /** | ||
54 | * Parse position top|bottom|left|right. | ||
55 | */ | ||
56 | uint32_t parse_position(const char *position); | ||
57 | |||
58 | /** | ||
59 | * Parse font. | ||
60 | */ | ||
61 | char *parse_font(const char *font); | ||
62 | |||
63 | /** | ||
64 | * Initialize default sway config. | ||
65 | */ | ||
66 | struct swaybar_config *init_config(); | ||
67 | |||
68 | /** | ||
69 | * Free config struct. | ||
70 | */ | ||
71 | void free_config(struct swaybar_config *config); | ||
72 | |||
73 | #endif /* _SWAYBAR_CONFIG_H */ | ||