diff options
author | 2018-03-30 00:11:00 -0400 | |
---|---|---|
committer | 2018-03-30 00:11:00 -0400 | |
commit | 9d7f47746cdcb0eed3cf41875d06a8ef238eef1c (patch) | |
tree | 997658454de40db3f8b76b68d658efaf2b686188 /include/swaybar/config.h | |
parent | Merge pull request #1654 from acrisci/refactor-2-electric-boogaloo (diff) | |
parent | Merge remote-tracking branch 'origin/wlroots' into swaybar-layers (diff) | |
download | sway-9d7f47746cdcb0eed3cf41875d06a8ef238eef1c.tar.gz sway-9d7f47746cdcb0eed3cf41875d06a8ef238eef1c.tar.zst sway-9d7f47746cdcb0eed3cf41875d06a8ef238eef1c.zip |
Merge pull request #1648 from swaywm/swaybar-layers
Port swaybar to layer shell
Diffstat (limited to 'include/swaybar/config.h')
-rw-r--r-- | include/swaybar/config.h | 60 |
1 files changed, 15 insertions, 45 deletions
diff --git a/include/swaybar/config.h b/include/swaybar/config.h index 651f0ee3..7634cb16 100644 --- a/include/swaybar/config.h +++ b/include/swaybar/config.h | |||
@@ -1,49 +1,35 @@ | |||
1 | #ifndef _SWAYBAR_CONFIG_H | 1 | #ifndef _SWAYBAR_CONFIG_H |
2 | #define _SWAYBAR_CONFIG_H | 2 | #define _SWAYBAR_CONFIG_H |
3 | |||
4 | #include <stdint.h> | ||
5 | #include <stdbool.h> | 3 | #include <stdbool.h> |
6 | 4 | #include <stdint.h> | |
7 | #include "list.h" | 5 | #include <wayland-client.h> |
8 | #include "util.h" | 6 | #include "util.h" |
9 | 7 | ||
10 | /** | ||
11 | * Colors for a box with background, border and text colors. | ||
12 | */ | ||
13 | struct box_colors { | 8 | struct box_colors { |
14 | uint32_t border; | 9 | uint32_t border; |
15 | uint32_t background; | 10 | uint32_t background; |
16 | uint32_t text; | 11 | uint32_t text; |
17 | }; | 12 | }; |
18 | 13 | ||
19 | /** | 14 | struct config_output { |
20 | * Swaybar config. | 15 | struct wl_list link; |
21 | */ | 16 | char *name; |
22 | struct config { | 17 | size_t index; |
18 | }; | ||
19 | |||
20 | struct swaybar_config { | ||
23 | char *status_command; | 21 | char *status_command; |
24 | bool pango_markup; | 22 | bool pango_markup; |
25 | uint32_t position; | 23 | uint32_t position; // zwlr_layer_surface_v1_anchor |
26 | char *font; | 24 | char *font; |
27 | char *sep_symbol; | 25 | char *sep_symbol; |
28 | char *mode; | 26 | char *mode; |
27 | bool mode_pango_markup; | ||
29 | bool strip_workspace_numbers; | 28 | bool strip_workspace_numbers; |
30 | bool binding_mode_indicator; | 29 | bool binding_mode_indicator; |
31 | bool wrap_scroll; | 30 | bool wrap_scroll; |
32 | bool workspace_buttons; | 31 | bool workspace_buttons; |
33 | bool all_outputs; | 32 | struct wl_list outputs; |
34 | list_t *outputs; | ||
35 | |||
36 | #ifdef ENABLE_TRAY | ||
37 | // Tray | ||
38 | char *tray_output; | ||
39 | char *icon_theme; | ||
40 | |||
41 | uint32_t tray_padding; | ||
42 | uint32_t activate_button; | ||
43 | uint32_t context_button; | ||
44 | uint32_t secondary_button; | ||
45 | #endif | ||
46 | |||
47 | int height; | 33 | int height; |
48 | 34 | ||
49 | struct { | 35 | struct { |
@@ -63,24 +49,8 @@ struct config { | |||
63 | } colors; | 49 | } colors; |
64 | }; | 50 | }; |
65 | 51 | ||
66 | /** | 52 | struct swaybar_config *init_config(); |
67 | * Parse position top|bottom|left|right. | 53 | void free_config(struct swaybar_config *config); |
68 | */ | ||
69 | uint32_t parse_position(const char *position); | 54 | uint32_t parse_position(const char *position); |
70 | 55 | ||
71 | /** | 56 | #endif |
72 | * Parse font. | ||
73 | */ | ||
74 | char *parse_font(const char *font); | ||
75 | |||
76 | /** | ||
77 | * Initialize default sway config. | ||
78 | */ | ||
79 | struct config *init_config(); | ||
80 | |||
81 | /** | ||
82 | * Free config struct. | ||
83 | */ | ||
84 | void free_config(struct config *config); | ||
85 | |||
86 | #endif /* _SWAYBAR_CONFIG_H */ | ||