aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/bar.c2
-rw-r--r--sway/commands/bar/status_edge_padding.c21
-rw-r--r--sway/commands/bar/status_padding.c21
-rw-r--r--sway/commands/input/events.c76
-rw-r--r--sway/config.c23
-rw-r--r--sway/config/bar.c4
-rw-r--r--sway/input/input-manager.c172
-rw-r--r--sway/input/seat.c37
-rw-r--r--sway/ipc-json.c25
-rw-r--r--sway/meson.build2
-rw-r--r--sway/sway-bar.5.scd12
-rw-r--r--sway/sway-input.5.scd9
12 files changed, 388 insertions, 16 deletions
diff --git a/sway/commands/bar.c b/sway/commands/bar.c
index 507ee10a..3e7c1b0f 100644
--- a/sway/commands/bar.c
+++ b/sway/commands/bar.c
@@ -23,6 +23,8 @@ static struct cmd_handler bar_handlers[] = {
{ "position", bar_cmd_position },
{ "separator_symbol", bar_cmd_separator_symbol },
{ "status_command", bar_cmd_status_command },
+ { "status_edge_padding", bar_cmd_status_edge_padding },
+ { "status_padding", bar_cmd_status_padding },
{ "strip_workspace_name", bar_cmd_strip_workspace_name },
{ "strip_workspace_numbers", bar_cmd_strip_workspace_numbers },
{ "tray_bindsym", bar_cmd_tray_bindsym },
diff --git a/sway/commands/bar/status_edge_padding.c b/sway/commands/bar/status_edge_padding.c
new file mode 100644
index 00000000..f3b10631
--- /dev/null
+++ b/sway/commands/bar/status_edge_padding.c
@@ -0,0 +1,21 @@
+#include <stdlib.h>
+#include <string.h>
+#include "sway/commands.h"
+#include "log.h"
+
+struct cmd_results *bar_cmd_status_edge_padding(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "status_edge_padding", EXPECTED_EQUAL_TO, 1))) {
+ return error;
+ }
+ char *end;
+ int padding = strtol(argv[0], &end, 10);
+ if (strlen(end) || padding < 0) {
+ return cmd_results_new(CMD_INVALID, "status_edge_padding",
+ "Padding must be a positive integer");
+ }
+ config->current_bar->status_edge_padding = padding;
+ wlr_log(WLR_DEBUG, "Status edge padding on bar %s: %d",
+ config->current_bar->id, config->current_bar->status_edge_padding);
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}
diff --git a/sway/commands/bar/status_padding.c b/sway/commands/bar/status_padding.c
new file mode 100644
index 00000000..13b8eb6b
--- /dev/null
+++ b/sway/commands/bar/status_padding.c
@@ -0,0 +1,21 @@
+#include <stdlib.h>
+#include <string.h>
+#include "sway/commands.h"
+#include "log.h"
+
+struct cmd_results *bar_cmd_status_padding(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "status_padding", EXPECTED_EQUAL_TO, 1))) {
+ return error;
+ }
+ char *end;
+ int padding = strtol(argv[0], &end, 10);
+ if (strlen(end) || padding < 0) {
+ return cmd_results_new(CMD_INVALID, "status_padding",
+ "Padding must be a positive integer");
+ }
+ config->current_bar->status_padding = padding;
+ wlr_log(WLR_DEBUG, "Status padding on bar %s: %d",
+ config->current_bar->id, config->current_bar->status_padding);
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c
index e7ed69c6..69f46269 100644
--- a/sway/commands/input/events.c
+++ b/sway/commands/input/events.c
@@ -1,10 +1,69 @@
+#include <limits.h>
#include <string.h>
#include <strings.h>
+#include <wlr/backend/libinput.h>
#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/input-manager.h"
#include "log.h"
+static void toggle_send_events_for_device(struct input_config *ic,
+ struct sway_input_device *input_device) {
+ struct wlr_input_device *wlr_device = input_device->wlr_device;
+ if (!wlr_input_device_is_libinput(wlr_device)) {
+ return;
+ }
+ struct libinput_device *libinput_dev
+ = wlr_libinput_get_device_handle(wlr_device);
+
+ enum libinput_config_send_events_mode mode =
+ libinput_device_config_send_events_get_mode(libinput_dev);
+ uint32_t possible =
+ libinput_device_config_send_events_get_modes(libinput_dev);
+
+ switch (mode) {
+ case LIBINPUT_CONFIG_SEND_EVENTS_ENABLED:
+ mode = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
+ if (possible & mode) {
+ break;
+ }
+ // fall through
+ case LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE:
+ mode = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
+ if (possible & mode) {
+ break;
+ }
+ // fall through
+ case LIBINPUT_CONFIG_SEND_EVENTS_DISABLED:
+ default:
+ mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
+ break;
+ }
+
+ ic->send_events = mode;
+}
+
+static void toggle_send_events(struct input_config *ic) {
+ struct sway_input_device *input_device = NULL;
+ wl_list_for_each(input_device, &server.input->devices, link) {
+ if (strcmp(input_device->identifier, ic->identifier) == 0) {
+ toggle_send_events_for_device(ic, input_device);
+ }
+ }
+}
+
+static void toggle_wildcard_send_events() {
+ struct sway_input_device *input_device = NULL;
+ wl_list_for_each(input_device, &server.input->devices, link) {
+ struct input_config *ic = new_input_config(input_device->identifier);
+ if (!ic) {
+ break;
+ }
+ toggle_send_events_for_device(ic, input_device);
+ store_input_config(ic);
+ }
+}
+
struct cmd_results *input_cmd_events(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) {
@@ -23,9 +82,24 @@ struct cmd_results *input_cmd_events(int argc, char **argv) {
} else if (strcasecmp(argv[0], "disabled_on_external_mouse") == 0) {
ic->send_events =
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
- } else {
+ } else if (config->reading) {
return cmd_results_new(CMD_INVALID, "events",
"Expected 'events <enabled|disabled|disabled_on_external_mouse>'");
+ } else if (strcasecmp(argv[0], "toggle") == 0) {
+ if (strcmp(ic->identifier, "*") == 0) {
+ // Update the device input configs and then reset the wildcard
+ // config send events mode so that is does not override the device
+ // ones. The device ones will be applied when attempting to apply
+ // the wildcard config
+ toggle_wildcard_send_events();
+ ic->send_events = INT_MIN;
+ } else {
+ toggle_send_events(ic);
+ }
+ } else {
+ return cmd_results_new(CMD_INVALID, "events",
+ "Expected 'events <enabled|disabled|disabled_on_external_mouse|"
+ "toggle>'");
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/config.c b/sway/config.c
index f99f043c..5ca4806c 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -387,6 +387,8 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
memcpy(&config->swaynag_config_errors,
&old_config->swaynag_config_errors,
sizeof(struct swaynag_instance));
+
+ input_manager_reset_all_inputs();
}
config->current_config_path = path;
@@ -571,15 +573,18 @@ bool load_include_configs(const char *path, struct sway_config *config,
}
// get line, with backslash continuation
-static ssize_t getline_with_cont(char **lineptr, size_t *line_size, FILE *file) {
+static ssize_t getline_with_cont(char **lineptr, size_t *line_size, FILE *file,
+ int *nlines) {
char *next_line = NULL;
size_t next_line_size = 0;
ssize_t nread = getline(lineptr, line_size, file);
+ *nlines = nread == -1 ? 0 : 1;
while (nread >= 2 && strcmp(&(*lineptr)[nread - 2], "\\\n") == 0) {
ssize_t next_nread = getline(&next_line, &next_line_size, file);
if (next_nread == -1) {
break;
}
+ (*nlines)++;
nread += next_nread - 2;
if ((ssize_t) *line_size < nread + 1) {
@@ -597,6 +602,7 @@ static ssize_t getline_with_cont(char **lineptr, size_t *line_size, FILE *file)
}
static int detect_brace(FILE *file) {
+ int ret = 0;
int lines = 0;
long pos = ftell(file);
char *line = NULL;
@@ -605,15 +611,17 @@ static int detect_brace(FILE *file) {
lines++;
strip_whitespace(line);
if (*line) {
- if (strcmp(line, "{") != 0) {
- fseek(file, pos, SEEK_SET);
- lines = 0;
+ if (strcmp(line, "{") == 0) {
+ ret = lines;
}
break;
}
}
free(line);
- return lines;
+ if (ret == 0) {
+ fseek(file, pos, SEEK_SET);
+ }
+ return ret;
}
static char *expand_line(const char *block, const char *line, bool add_brace) {
@@ -660,7 +668,8 @@ bool read_config(FILE *file, struct sway_config *config,
ssize_t nread;
list_t *stack = create_list();
size_t read = 0;
- while ((nread = getline_with_cont(&line, &line_size, file)) != -1) {
+ int nlines = 0;
+ while ((nread = getline_with_cont(&line, &line_size, file, &nlines)) != -1) {
if (reading_main_config) {
if (read + nread > config_size) {
wlr_log(WLR_ERROR, "Config file changed during reading");
@@ -676,7 +685,7 @@ bool read_config(FILE *file, struct sway_config *config,
line[nread - 1] = '\0';
}
- line_number++;
+ line_number += nlines;
wlr_log(WLR_DEBUG, "Read line %d: %s", line_number, line);
strip_whitespace(line);
diff --git a/sway/config/bar.c b/sway/config/bar.c
index 670219f1..701bf051 100644
--- a/sway/config/bar.c
+++ b/sway/config/bar.c
@@ -96,7 +96,7 @@ struct bar_config *default_bar_config(void) {
bar->pango_markup = false;
bar->swaybar_command = NULL;
bar->font = NULL;
- bar->height = -1;
+ bar->height = 0;
bar->workspace_buttons = true;
bar->wrap_scroll = false;
bar->separator_symbol = NULL;
@@ -106,6 +106,8 @@ struct bar_config *default_bar_config(void) {
bar->verbose = false;
bar->pid = 0;
bar->modifier = get_modifier_mask_by_name("Mod4");
+ bar->status_padding = 1;
+ bar->status_edge_padding = 3;
if (!(bar->mode = strdup("dock"))) {
goto cleanup;
}
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 04e14355..d90803f6 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -129,6 +129,24 @@ static void input_manager_libinput_config_keyboard(
}
}
+static void input_manager_libinput_reset_keyboard(
+ struct sway_input_device *input_device) {
+ struct wlr_input_device *wlr_device = input_device->wlr_device;
+ struct libinput_device *libinput_device;
+
+ if (!wlr_input_device_is_libinput(wlr_device)) {
+ return;
+ }
+
+ libinput_device = wlr_libinput_get_device_handle(wlr_device);
+
+ uint32_t send_events =
+ libinput_device_config_send_events_get_default_mode(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_keyboard(%s) send_events_set_mode(%d)",
+ input_device->identifier, send_events);
+ libinput_device_config_send_events_set_mode(libinput_device, send_events);
+}
+
static void input_manager_libinput_config_touch(
struct sway_input_device *input_device) {
struct wlr_input_device *wlr_device = input_device->wlr_device;
@@ -151,6 +169,24 @@ static void input_manager_libinput_config_touch(
}
}
+static void input_manager_libinput_reset_touch(
+ struct sway_input_device *input_device) {
+ struct wlr_input_device *wlr_device = input_device->wlr_device;
+ struct libinput_device *libinput_device;
+
+ if (!wlr_input_device_is_libinput(wlr_device)) {
+ return;
+ }
+
+ libinput_device = wlr_libinput_get_device_handle(wlr_device);
+
+ uint32_t send_events =
+ libinput_device_config_send_events_get_default_mode(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_touch(%s) send_events_set_mode(%d)",
+ input_device->identifier, send_events);
+ libinput_device_config_send_events_set_mode(libinput_device, send_events);
+}
+
static void input_manager_libinput_config_pointer(
struct sway_input_device *input_device) {
struct wlr_input_device *wlr_device = input_device->wlr_device;
@@ -180,14 +216,14 @@ static void input_manager_libinput_config_pointer(
if (ic->drag != INT_MIN) {
wlr_log(WLR_DEBUG,
"libinput_config_pointer(%s) tap_set_drag_enabled(%d)",
- ic->identifier, ic->click_method);
+ ic->identifier, ic->drag);
libinput_device_config_tap_set_drag_enabled(libinput_device,
ic->drag);
}
if (ic->drag_lock != INT_MIN) {
wlr_log(WLR_DEBUG,
"libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)",
- ic->identifier, ic->click_method);
+ ic->identifier, ic->drag_lock);
libinput_device_config_tap_set_drag_lock_enabled(libinput_device,
ic->drag_lock);
}
@@ -248,12 +284,118 @@ static void input_manager_libinput_config_pointer(
}
if (ic->tap_button_map != INT_MIN) {
wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_button_map(%d)",
- ic->identifier, ic->tap);
+ ic->identifier, ic->tap_button_map);
libinput_device_config_tap_set_button_map(libinput_device,
ic->tap_button_map);
}
}
+static void input_manager_libinput_reset_pointer(
+ struct sway_input_device *input_device) {
+ struct wlr_input_device *wlr_device = input_device->wlr_device;
+
+ if (!wlr_input_device_is_libinput(wlr_device)) {
+ return;
+ }
+
+ struct libinput_device *libinput_device =
+ wlr_libinput_get_device_handle(wlr_device);
+
+ enum libinput_config_accel_profile accel_profile =
+ libinput_device_config_accel_get_default_profile(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_profile(%d)",
+ input_device->identifier, accel_profile);
+ libinput_device_config_accel_set_profile(libinput_device, accel_profile);
+
+ enum libinput_config_click_method click_method =
+ libinput_device_config_click_get_default_method(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) click_set_method(%d)",
+ input_device->identifier, click_method);
+ libinput_device_config_click_set_method(libinput_device, click_method);
+
+ enum libinput_config_drag_state drag =
+ libinput_device_config_tap_get_default_drag_enabled(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_drag_enabled(%d)",
+ input_device->identifier, drag);
+ libinput_device_config_tap_set_drag_enabled(libinput_device, drag);
+
+ enum libinput_config_drag_lock_state drag_lock =
+ libinput_device_config_tap_get_default_drag_lock_enabled(
+ libinput_device);
+ wlr_log(WLR_DEBUG,
+ "libinput_reset_pointer(%s) tap_set_drag_lock_enabled(%d)",
+ input_device->identifier, drag_lock);
+ libinput_device_config_tap_set_drag_lock_enabled(libinput_device,
+ drag_lock);
+
+ enum libinput_config_dwt_state dwt =
+ libinput_device_config_dwt_get_default_enabled(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) dwt_set_enabled(%d)",
+ input_device->identifier, dwt);
+ libinput_device_config_dwt_set_enabled(libinput_device, dwt);
+
+ int left_handed =
+ libinput_device_config_left_handed_get_default(libinput_device);
+ wlr_log(WLR_DEBUG,
+ "libinput_reset_pointer(%s) left_handed_set_enabled(%d)",
+ input_device->identifier, left_handed);
+ libinput_device_config_left_handed_set(libinput_device, left_handed);
+
+ enum libinput_config_middle_emulation_state middle_emulation =
+ libinput_device_config_middle_emulation_get_default_enabled(
+ libinput_device);
+ wlr_log(WLR_DEBUG,
+ "libinput_reset_pointer(%s) middle_emulation_set_enabled(%d)",
+ input_device->identifier, middle_emulation);
+ libinput_device_config_middle_emulation_set_enabled(libinput_device,
+ middle_emulation);
+
+ int natural_scroll =
+ libinput_device_config_scroll_get_default_natural_scroll_enabled(
+ libinput_device);
+ wlr_log(WLR_DEBUG,
+ "libinput_reset_pointer(%s) natural_scroll_set_enabled(%d)",
+ input_device->identifier, natural_scroll);
+ libinput_device_config_scroll_set_natural_scroll_enabled(
+ libinput_device, natural_scroll);
+
+ double pointer_accel =
+ libinput_device_config_accel_get_default_speed(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_speed(%f)",
+ input_device->identifier, pointer_accel);
+ libinput_device_config_accel_set_speed(libinput_device, pointer_accel);
+
+ uint32_t scroll_button =
+ libinput_device_config_scroll_get_default_button(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_button(%d)",
+ input_device->identifier, scroll_button);
+ libinput_device_config_scroll_set_button(libinput_device, scroll_button);
+
+ enum libinput_config_scroll_method scroll_method =
+ libinput_device_config_scroll_get_default_method(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_method(%d)",
+ input_device->identifier, scroll_method);
+ libinput_device_config_scroll_set_method(libinput_device, scroll_method);
+
+ uint32_t send_events =
+ libinput_device_config_send_events_get_default_mode(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) send_events_set_mode(%d)",
+ input_device->identifier, send_events);
+ libinput_device_config_send_events_set_mode(libinput_device, send_events);
+
+ enum libinput_config_tap_state tap =
+ libinput_device_config_tap_get_default_enabled(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_enabled(%d)",
+ input_device->identifier, tap);
+ libinput_device_config_tap_set_enabled(libinput_device, tap);
+
+ enum libinput_config_tap_button_map tap_button_map =
+ libinput_device_config_tap_get_button_map(libinput_device);
+ wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_button_map(%d)",
+ input_device->identifier, tap_button_map);
+ libinput_device_config_tap_set_button_map(libinput_device, tap_button_map);
+}
+
static void handle_device_destroy(struct wl_listener *listener, void *data) {
struct wlr_input_device *device = data;
@@ -466,6 +608,30 @@ void input_manager_apply_input_config(struct input_config *input_config) {
}
}
+void input_manager_reset_input(struct sway_input_device *input_device) {
+ if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER ||
+ input_device->wlr_device->type == WLR_INPUT_DEVICE_TABLET_TOOL) {
+ input_manager_libinput_reset_pointer(input_device);
+ } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_KEYBOARD) {
+ input_manager_libinput_reset_keyboard(input_device);
+ } else if (input_device->wlr_device->type == WLR_INPUT_DEVICE_TOUCH) {
+ input_manager_libinput_reset_touch(input_device);
+ }
+
+ struct sway_seat *seat = NULL;
+ wl_list_for_each(seat, &server.input->seats, link) {
+ seat_reset_device(seat, input_device);
+ }
+}
+
+void input_manager_reset_all_inputs() {
+ struct sway_input_device *input_device = NULL;
+ wl_list_for_each(input_device, &server.input->devices, link) {
+ input_manager_reset_input(input_device);
+ }
+}
+
+
void input_manager_apply_seat_config(struct seat_config *seat_config) {
wlr_log(WLR_DEBUG, "applying seat config for seat %s", seat_config->name);
if (strcmp(seat_config->name, "*") == 0) {
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 7bd889d7..a63999b6 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -405,6 +405,14 @@ static void seat_update_capabilities(struct sway_seat *seat) {
}
}
+static void seat_reset_input_config(struct sway_seat *seat,
+ struct sway_seat_device *sway_device) {
+ wlr_log(WLR_DEBUG, "Resetting output mapping for input device %s",
+ sway_device->input_device->identifier);
+ wlr_cursor_map_input_to_output(seat->cursor->cursor,
+ sway_device->input_device->wlr_device, NULL);
+}
+
static void seat_apply_input_config(struct sway_seat *seat,
struct sway_seat_device *sway_device) {
const char *mapped_to_output = NULL;
@@ -522,6 +530,35 @@ void seat_configure_device(struct sway_seat *seat,
}
}
+void seat_reset_device(struct sway_seat *seat,
+ struct sway_input_device *input_device) {
+ struct sway_seat_device *seat_device = seat_get_device(seat, input_device);
+ if (!seat_device) {
+ return;
+ }
+
+ switch (input_device->wlr_device->type) {
+ case WLR_INPUT_DEVICE_POINTER:
+ seat_reset_input_config(seat, seat_device);
+ break;
+ case WLR_INPUT_DEVICE_KEYBOARD:
+ sway_keyboard_configure(seat_device->keyboard);
+ break;
+ case WLR_INPUT_DEVICE_TOUCH:
+ seat_reset_input_config(seat, seat_device);
+ break;
+ case WLR_INPUT_DEVICE_TABLET_TOOL:
+ seat_reset_input_config(seat, seat_device);
+ break;
+ case WLR_INPUT_DEVICE_TABLET_PAD:
+ wlr_log(WLR_DEBUG, "TODO: reset tablet pad");
+ break;
+ case WLR_INPUT_DEVICE_SWITCH:
+ wlr_log(WLR_DEBUG, "TODO: reset switch device");
+ break;
+ }
+}
+
void seat_add_device(struct sway_seat *seat,
struct sway_input_device *input_device) {
if (seat_get_device(seat, input_device)) {
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 53e0e335..15f89f65 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -11,6 +11,7 @@
#include "sway/output.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
+#include <wlr/backend/libinput.h>
#include <wlr/types/wlr_box.h>
#include <wlr/types/wlr_output.h>
#include <xkbcommon/xkbcommon.h>
@@ -598,6 +599,26 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) {
}
}
+ if (wlr_input_device_is_libinput(device->wlr_device)) {
+ struct libinput_device *libinput_dev;
+ libinput_dev = wlr_libinput_get_device_handle(device->wlr_device);
+
+ const char *events = "unknown";
+ switch (libinput_device_config_send_events_get_mode(libinput_dev)) {
+ case LIBINPUT_CONFIG_SEND_EVENTS_ENABLED:
+ events = "enabled";
+ break;
+ case LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE:
+ events = "disabled_on_external_mouse";
+ break;
+ case LIBINPUT_CONFIG_SEND_EVENTS_DISABLED:
+ events = "disabled";
+ break;
+ }
+ json_object_object_add(object, "libinput_send_events",
+ json_object_new_string(events));
+ }
+
return object;
}
@@ -660,6 +681,10 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) {
}
json_object_object_add(json, "bar_height",
json_object_new_int(bar->height));
+ json_object_object_add(json, "status_padding",
+ json_object_new_int(bar->status_padding));
+ json_object_object_add(json, "status_edge_padding",
+ json_object_new_int(bar->status_edge_padding));
json_object_object_add(json, "wrap_scroll",
json_object_new_boolean(bar->wrap_scroll));
json_object_object_add(json, "workspace_buttons",
diff --git a/sway/meson.build b/sway/meson.build
index ff326f04..b49d550a 100644
--- a/sway/meson.build
+++ b/sway/meson.build
@@ -121,6 +121,8 @@ sway_sources = files(
'commands/bar/position.c',
'commands/bar/separator_symbol.c',
'commands/bar/status_command.c',
+ 'commands/bar/status_edge_padding.c',
+ 'commands/bar/status_padding.c',
'commands/bar/strip_workspace_numbers.c',
'commands/bar/strip_workspace_name.c',
'commands/bar/swaybar_command.c',
diff --git a/sway/sway-bar.5.scd b/sway/sway-bar.5.scd
index 2357591d..e1a4a937 100644
--- a/sway/sway-bar.5.scd
+++ b/sway/sway-bar.5.scd
@@ -69,7 +69,7 @@ Sway allows configuring swaybar in the sway configuration file.
use.
*height* <height>
- Sets the height of the bar. Default height will match the font size.
+ Sets the height of the bar. Default height (0) will match the font size.
*bindsym* [--release] button<n> <command>
Executes _command_ when mouse button _n_ has been pressed (or if _released_
@@ -92,6 +92,16 @@ Sway allows configuring swaybar in the sway configuration file.
*modifier* <Modifier>|none
Specifies the modifier key that shows a hidden bar. Default is _Mod4_.
+*status\_padding* <padding>
+ Sets the vertical padding that is used for the status line. The default is
+ _1_. If _padding_ is _0_, blocks will be able to take up the full height of
+ the bar. This value will be multiplied by the output scale.
+
+*status\_edge\_padding* <padding>
+ Sets the padding that is used when the status line is at the right edge of
+ the bar. This value will be multiplied by the output scale. The default is
+ _3_.
+
## TRAY
Swaybar provides a system tray where third-party applications may place icons.
diff --git a/sway/sway-input.5.scd b/sway/sway-input.5.scd
index 820194a9..c54babaa 100644
--- a/sway/sway-input.5.scd
+++ b/sway/sway-input.5.scd
@@ -82,9 +82,12 @@ The following commands may only be used in the configuration file.
*input* <identifier> dwt enabled|disabled
Enables or disables disable-while-typing for the specified input device.
-*input* <identifier> events enabled|disabled|disabled\_on\_external\_mouse
- Enables or disables send\_events for specified input device. (Disabling
- send\_events disables the input device)
+*input* <identifier> events enabled|disabled|disabled\_on\_external\_mouse|toggle
+ Enables or disables send\_events for specified input device. Disabling
+ send\_events disables the input device. The _toggle_ option cannot be used
+ in the config. The order is enabled, disabled\_on\_external\_mouse,
+ disabled, (loop back to enabled). Any mode which is not supported by the
+ device will be skipped during the toggle.
*input* <identifier> left\_handed enabled|disabled
Enables or disables left handed mode for specified input device.