diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-24 15:55:58 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-24 15:55:58 +0100 |
commit | ed227f5664196d85194d63d01a5382499867a386 (patch) | |
tree | 0474bff44ae5880fd3336a0a9dd04641793f153e /include/bar/config.h | |
parent | Merge pull request #467 from mikkeloscar/swaybar-refactor (diff) | |
download | sway-ed227f5664196d85194d63d01a5382499867a386.tar.gz sway-ed227f5664196d85194d63d01a5382499867a386.tar.zst sway-ed227f5664196d85194d63d01a5382499867a386.zip |
swaybar: move headers to include/bar
Diffstat (limited to 'include/bar/config.h')
-rw-r--r-- | include/bar/config.h | 69 |
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 | */ | ||
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 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 | */ | ||
47 | uint32_t parse_color(const char *color); | ||
48 | |||
49 | /** | ||
50 | * Parse position top|bottom|left|right. | ||
51 | */ | ||
52 | uint32_t parse_position(const char *position); | ||
53 | |||
54 | /** | ||
55 | * Parse font. | ||
56 | */ | ||
57 | char *parse_font(const char *font); | ||
58 | |||
59 | /** | ||
60 | * Initialize default sway config. | ||
61 | */ | ||
62 | struct config *init_config(); | ||
63 | |||
64 | /** | ||
65 | * Free config struct. | ||
66 | */ | ||
67 | void free_config(struct config *config); | ||
68 | |||
69 | #endif /* _SWAYBAR_CONFIG_H */ | ||