diff options
author | 2016-02-27 16:18:50 -0500 | |
---|---|---|
committer | 2016-02-27 16:18:50 -0500 | |
commit | 3453910c3e887be900c69394b738e34d9d8ba095 (patch) | |
tree | 28e0d8d72557ac57a2f9aed5c94818c8ba20e97f /include | |
parent | Set pointer pos before focusing view under it (diff) | |
parent | Free config before exiting sway. (diff) | |
download | sway-3453910c3e887be900c69394b738e34d9d8ba095.tar.gz sway-3453910c3e887be900c69394b738e34d9d8ba095.tar.zst sway-3453910c3e887be900c69394b738e34d9d8ba095.zip |
Merge pull request #492 from mikkeloscar/swaybar-multi-output
Display single swaybar on multiple outputs
Diffstat (limited to 'include')
-rw-r--r-- | include/bar/bar.h | 11 | ||||
-rw-r--r-- | include/bar/config.h | 4 | ||||
-rw-r--r-- | include/bar/ipc.h | 2 | ||||
-rw-r--r-- | include/config.h | 8 | ||||
-rw-r--r-- | include/container.h | 4 |
5 files changed, 20 insertions, 9 deletions
diff --git a/include/bar/bar.h b/include/bar/bar.h index 89496da6..c20efc55 100644 --- a/include/bar/bar.h +++ b/include/bar/bar.h | |||
@@ -8,8 +8,7 @@ | |||
8 | struct bar { | 8 | struct bar { |
9 | struct config *config; | 9 | struct config *config; |
10 | struct status_line *status; | 10 | struct status_line *status; |
11 | struct output *output; | 11 | list_t *outputs; |
12 | /* list_t *outputs; */ | ||
13 | 12 | ||
14 | int ipc_event_socketfd; | 13 | int ipc_event_socketfd; |
15 | int ipc_socketfd; | 14 | int ipc_socketfd; |
@@ -22,6 +21,7 @@ struct output { | |||
22 | struct registry *registry; | 21 | struct registry *registry; |
23 | list_t *workspaces; | 22 | list_t *workspaces; |
24 | char *name; | 23 | char *name; |
24 | int idx; | ||
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct workspace { | 27 | struct workspace { |
@@ -35,7 +35,12 @@ struct workspace { | |||
35 | /** | 35 | /** |
36 | * Setup bar. | 36 | * Setup bar. |
37 | */ | 37 | */ |
38 | void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id, int desired_output); | 38 | void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id); |
39 | |||
40 | /** | ||
41 | * Create new output struct from name. | ||
42 | */ | ||
43 | struct output *new_output(const char *name); | ||
39 | 44 | ||
40 | /** | 45 | /** |
41 | * Bar mainloop. | 46 | * Bar mainloop. |
diff --git a/include/bar/config.h b/include/bar/config.h index 508b9c42..fc938c38 100644 --- a/include/bar/config.h +++ b/include/bar/config.h | |||
@@ -4,6 +4,8 @@ | |||
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | #include <stdbool.h> | 5 | #include <stdbool.h> |
6 | 6 | ||
7 | #include "list.h" | ||
8 | |||
7 | /** | 9 | /** |
8 | * Colors for a box with background, border and text colors. | 10 | * Colors for a box with background, border and text colors. |
9 | */ | 11 | */ |
@@ -25,6 +27,8 @@ struct config { | |||
25 | bool strip_workspace_numbers; | 27 | bool strip_workspace_numbers; |
26 | bool binding_mode_indicator; | 28 | bool binding_mode_indicator; |
27 | bool workspace_buttons; | 29 | bool workspace_buttons; |
30 | bool all_outputs; | ||
31 | list_t *outputs; | ||
28 | 32 | ||
29 | int height; | 33 | int height; |
30 | 34 | ||
diff --git a/include/bar/ipc.h b/include/bar/ipc.h index c3f661f8..741c067b 100644 --- a/include/bar/ipc.h +++ b/include/bar/ipc.h | |||
@@ -6,7 +6,7 @@ | |||
6 | /** | 6 | /** |
7 | * Initialize ipc connection to sway and get sway state, outputs, bar_config. | 7 | * Initialize ipc connection to sway and get sway state, outputs, bar_config. |
8 | */ | 8 | */ |
9 | void ipc_bar_init(struct bar *bar, int outputi, const char *bar_id); | 9 | void ipc_bar_init(struct bar *bar, const char *bar_id); |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * Handle ipc event from sway. | 12 | * Handle ipc event from sway. |
diff --git a/include/config.h b/include/config.h index 655d0a9c..d77872ee 100644 --- a/include/config.h +++ b/include/config.h | |||
@@ -125,6 +125,7 @@ struct bar_config { | |||
125 | bool strip_workspace_numbers; | 125 | bool strip_workspace_numbers; |
126 | bool binding_mode_indicator; | 126 | bool binding_mode_indicator; |
127 | bool verbose; | 127 | bool verbose; |
128 | pid_t pid; | ||
128 | struct { | 129 | struct { |
129 | char background[10]; | 130 | char background[10]; |
130 | char statusline[10]; | 131 | char statusline[10]; |
@@ -192,6 +193,10 @@ bool load_config(const char *file); | |||
192 | */ | 193 | */ |
193 | bool read_config(FILE *file, bool is_active); | 194 | bool read_config(FILE *file, bool is_active); |
194 | /** | 195 | /** |
196 | * Free config struct | ||
197 | */ | ||
198 | void free_config(struct sway_config *config); | ||
199 | /** | ||
195 | * Does variable replacement for a string based on the config's currently loaded variables. | 200 | * Does variable replacement for a string based on the config's currently loaded variables. |
196 | */ | 201 | */ |
197 | char *do_var_replacement(char *str); | 202 | char *do_var_replacement(char *str); |
@@ -226,8 +231,7 @@ int sway_mouse_binding_cmp_qsort(const void *a, const void *b); | |||
226 | int sway_mouse_binding_cmp_buttons(const void *a, const void *b); | 231 | int sway_mouse_binding_cmp_buttons(const void *a, const void *b); |
227 | void free_sway_mouse_binding(struct sway_mouse_binding *smb); | 232 | void free_sway_mouse_binding(struct sway_mouse_binding *smb); |
228 | 233 | ||
229 | void load_swaybars(swayc_t *output, int output_idx); | 234 | void load_swaybars(); |
230 | void terminate_swaybars(list_t *pids); | ||
231 | void terminate_swaybg(pid_t pid); | 235 | void terminate_swaybg(pid_t pid); |
232 | 236 | ||
233 | /** | 237 | /** |
diff --git a/include/container.h b/include/container.h index d5126e74..a96beab9 100644 --- a/include/container.h +++ b/include/container.h | |||
@@ -82,9 +82,7 @@ struct sway_container { | |||
82 | char *class; | 82 | char *class; |
83 | char *app_id; | 83 | char *app_id; |
84 | 84 | ||
85 | // Used by output containers to keep track of swaybar/swaybg child | 85 | // Used by output containers to keep track of swaybg child processes. |
86 | // processes. | ||
87 | list_t *bar_pids; | ||
88 | pid_t bg_pid; | 86 | pid_t bg_pid; |
89 | 87 | ||
90 | int gaps; | 88 | int gaps; |