summaryrefslogtreecommitdiffstats
path: root/swaybar/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/config.c')
-rw-r--r--swaybar/config.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/swaybar/config.c b/swaybar/config.c
index 0fd1f02e..d4cc9b1a 100644
--- a/swaybar/config.c
+++ b/swaybar/config.c
@@ -1,9 +1,10 @@
1#define _XOPEN_SOURCE 500 1#define _POSIX_C_SOURCE 200809L
2#include <stdlib.h> 2#include <stdlib.h>
3#include <string.h> 3#include <string.h>
4#include <wlr/util/log.h> 4#include <wlr/util/log.h>
5#include "swaybar/config.h" 5#include "swaybar/config.h"
6#include "wlr-layer-shell-unstable-v1-client-protocol.h" 6#include "wlr-layer-shell-unstable-v1-client-protocol.h"
7#include "config.h"
7#include "stringop.h" 8#include "stringop.h"
8#include "list.h" 9#include "list.h"
9 10
@@ -30,15 +31,24 @@ struct swaybar_config *init_config(void) {
30 config->hidden_state = strdup("hide"); 31 config->hidden_state = strdup("hide");
31 config->sep_symbol = NULL; 32 config->sep_symbol = NULL;
32 config->strip_workspace_numbers = false; 33 config->strip_workspace_numbers = false;
34 config->strip_workspace_name = false;
33 config->binding_mode_indicator = true; 35 config->binding_mode_indicator = true;
34 config->wrap_scroll = false; 36 config->wrap_scroll = false;
35 config->workspace_buttons = true; 37 config->workspace_buttons = true;
36 config->bindings = create_list(); 38 config->bindings = create_list();
37 wl_list_init(&config->outputs); 39 wl_list_init(&config->outputs);
40 config->status_padding = 1;
41 config->status_edge_padding = 3;
38 42
39 /* height */ 43 /* height */
40 config->height = 0; 44 config->height = 0;
41 45
46 /* gaps */
47 config->gaps.top = 0;
48 config->gaps.right = 0;
49 config->gaps.bottom = 0;
50 config->gaps.left = 0;
51
42 /* colors */ 52 /* colors */
43 config->colors.background = 0x000000FF; 53 config->colors.background = 0x000000FF;
44 config->colors.focused_background = 0x000000FF; 54 config->colors.focused_background = 0x000000FF;
@@ -66,6 +76,10 @@ struct swaybar_config *init_config(void) {
66 config->colors.binding_mode.background = 0x900000FF; 76 config->colors.binding_mode.background = 0x900000FF;
67 config->colors.binding_mode.text = 0xFFFFFFFF; 77 config->colors.binding_mode.text = 0xFFFFFFFF;
68 78
79#if HAVE_TRAY
80 config->tray_padding = 2;
81#endif
82
69 return config; 83 return config;
70} 84}
71 85
@@ -95,5 +109,12 @@ void free_config(struct swaybar_config *config) {
95 free(coutput->name); 109 free(coutput->name);
96 free(coutput); 110 free(coutput);
97 } 111 }
112#if HAVE_TRAY
113 list_free_items_and_destroy(config->tray_outputs);
114 for (int i = 0; i < 10; ++i) {
115 free(config->tray_bindings[i]);
116 }
117 free(config->icon_theme);
118#endif
98 free(config); 119 free(config);
99} 120}