From 152e30c374382eecccb917e5c26d72a2ea53ef87 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 9 Jul 2019 02:57:59 -0400 Subject: cmd_bindswitch: add option to execute on reload This adds a --reload flag to cmd_bindswitch that allows for the binding to be executed on reload. One possible use case for this is to allow users to disable outputs when the lid closes and enable them when the lid opens without having to open and re-close the lid after a reload. --- sway/config.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index 70f2d706..74080898 100644 --- a/sway/config.c +++ b/sway/config.c @@ -17,6 +17,7 @@ #include #include "sway/input/input-manager.h" #include "sway/input/seat.h" +#include "sway/input/switch.h" #include "sway/commands.h" #include "sway/config.h" #include "sway/criteria.h" @@ -520,6 +521,12 @@ bool load_main_config(const char *file, bool is_active, bool validating) { } if (is_active) { + input_manager_verify_fallback_seat(); + for (int i = 0; i < config->seat_configs->length; i++) { + input_manager_apply_seat_config(config->seat_configs->items[i]); + } + sway_switch_retrigger_bindings_for_all(); + reset_outputs(); spawn_swaybg(); @@ -527,11 +534,6 @@ bool load_main_config(const char *file, bool is_active, bool validating) { if (config->swaynag_config_errors.client != NULL) { swaynag_show(&config->swaynag_config_errors); } - - input_manager_verify_fallback_seat(); - for (int i = 0; i < config->seat_configs->length; i++) { - input_manager_apply_seat_config(config->seat_configs->items[i]); - } } if (old_config) { -- cgit v1.2.3-54-g00ecf