aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-10-08 21:40:09 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-10-08 22:23:55 +1000
commit41bfd8c790e6c34dfee9c0135b2455f4ba34c619 (patch)
tree09c84d0021a8cf7a6ae62f2623ff3739e2fc824e
parentb3b17280de54021657eabf2df4c3dbfd0039bac8 (diff)
downloadsway-41bfd8c790e6c34dfee9c0135b2455f4ba34c619.zip
sway-41bfd8c790e6c34dfee9c0135b2455f4ba34c619.tar.gz
sway-41bfd8c790e6c34dfee9c0135b2455f4ba34c619.tar.bz2
swaybar: allow null status_command
Sway sets a default status_command which runs date every second. This patch removes this behaviour so the user can have a NULL status bar if desired. I had to swap swaybar's event_loop_poll and wl_display_flush so that it would map the initial surface.
-rw-r--r--sway/config/bar.c4
-rw-r--r--sway/ipc-json.c4
-rw-r--r--swaybar/bar.c2
3 files changed, 3 insertions, 7 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c
index 48a632f..b869579 100644
--- a/sway/config/bar.c
+++ b/sway/config/bar.c
@@ -99,10 +99,6 @@ struct bar_config *default_bar_config(void) {
if (!(bar->bindings = create_list())) {
goto cleanup;
}
- if (!(bar->status_command =
- strdup("while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done"))) {
- goto cleanup;
- }
// set default colors
if (!(bar->colors.background = strndup("#000000ff", 9))) {
goto cleanup;
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 7c5a0a5..f02f370 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -514,8 +514,8 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) {
json_object_new_string(bar->hidden_state));
json_object_object_add(json, "position",
json_object_new_string(bar->position));
- json_object_object_add(json, "status_command",
- json_object_new_string(bar->status_command));
+ json_object_object_add(json, "status_command", bar->status_command ?
+ json_object_new_string(bar->status_command) : NULL);
json_object_object_add(json, "font",
json_object_new_string((bar->font) ? bar->font : config->font));
if (bar->separator_symbol) {
diff --git a/swaybar/bar.c b/swaybar/bar.c
index c86e71b..3990f1c 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -572,8 +572,8 @@ void bar_run(struct swaybar *bar) {
add_event(bar->status->read_fd, POLLIN, status_in, bar);
}
while (1) {
- event_loop_poll();
wl_display_flush(bar->display);
+ event_loop_poll();
}
}