aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-11-29 17:02:09 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-11-29 17:05:04 -0500
commit4f89735fc4d33cb19d97fba253708da8dfe14210 (patch)
tree799754ced938aec650f0a1bc488be58d0c890918 /sway
parentMerge pull request #278 from christophgysin/merge (diff)
downloadsway-4f89735fc4d33cb19d97fba253708da8dfe14210.tar.gz
sway-4f89735fc4d33cb19d97fba253708da8dfe14210.tar.zst
sway-4f89735fc4d33cb19d97fba253708da8dfe14210.zip
Add bar config struct and defaults
Diffstat (limited to 'sway')
-rw-r--r--sway/config.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index aa4675ce..59e6e476 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -3,6 +3,7 @@
3#include <stdlib.h> 3#include <stdlib.h>
4#include <unistd.h> 4#include <unistd.h>
5#include <wordexp.h> 5#include <wordexp.h>
6#include "wayland-desktop-shell-server-protocol.h"
6#include "readline.h" 7#include "readline.h"
7#include "stringop.h" 8#include "stringop.h"
8#include "list.h" 9#include "list.h"
@@ -115,6 +116,18 @@ static void config_defaults(struct sway_config *config) {
115 config->edge_gaps = true; 116 config->edge_gaps = true;
116 config->gaps_inner = 0; 117 config->gaps_inner = 0;
117 config->gaps_outer = 0; 118 config->gaps_outer = 0;
119
120 // Bar
121 config->bar.mode = "dock";
122 config->bar.hidden_state = "hide";
123 config->bar.modifier = 0;
124 config->bar.position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM;
125 config->bar.status_command = "while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done";
126 config->bar.font = "monospace 10";
127 config->bar.bar_height = -1;
128 config->bar.workspace_buttons = true;
129 config->bar.strip_workspace_numbers = false;
130 config->bar.binding_mode_indicator = true;
118} 131}
119 132
120static char *get_config_path(void) { 133static char *get_config_path(void) {
@@ -190,7 +203,7 @@ bool load_config(const char *file) {
190 203
191bool read_config(FILE *file, bool is_active) { 204bool read_config(FILE *file, bool is_active) {
192 struct sway_config *old_config = config; 205 struct sway_config *old_config = config;
193 config = malloc(sizeof(struct sway_config)); 206 config = calloc(1, sizeof(struct sway_config));
194 207
195 config_defaults(config); 208 config_defaults(config);
196 config->reading = true; 209 config->reading = true;