summaryrefslogtreecommitdiff
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 @@
-#define _XOPEN_SOURCE 500
+#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
#include <string.h>
#include <wlr/util/log.h>
#include "swaybar/config.h"
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
+#include "config.h"
#include "stringop.h"
#include "list.h"
@@ -30,15 +31,24 @@ struct swaybar_config *init_config(void) {
config->hidden_state = strdup("hide");
config->sep_symbol = NULL;
config->strip_workspace_numbers = false;
+ config->strip_workspace_name = false;
config->binding_mode_indicator = true;
config->wrap_scroll = false;
config->workspace_buttons = true;
config->bindings = create_list();
wl_list_init(&config->outputs);
+ config->status_padding = 1;
+ config->status_edge_padding = 3;
/* height */
config->height = 0;
+ /* gaps */
+ config->gaps.top = 0;
+ config->gaps.right = 0;
+ config->gaps.bottom = 0;
+ config->gaps.left = 0;
+
/* colors */
config->colors.background = 0x000000FF;
config->colors.focused_background = 0x000000FF;
@@ -66,6 +76,10 @@ struct swaybar_config *init_config(void) {
config->colors.binding_mode.background = 0x900000FF;
config->colors.binding_mode.text = 0xFFFFFFFF;
+#if HAVE_TRAY
+ config->tray_padding = 2;
+#endif
+
return config;
}
@@ -95,5 +109,12 @@ void free_config(struct swaybar_config *config) {
free(coutput->name);
free(coutput);
}
+#if HAVE_TRAY
+ list_free_items_and_destroy(config->tray_outputs);
+ for (int i = 0; i < 10; ++i) {
+ free(config->tray_bindings[i]);
+ }
+ free(config->icon_theme);
+#endif
free(config);
}