diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-07-09 02:57:59 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-07-09 10:00:57 +0300 |
commit | 152e30c374382eecccb917e5c26d72a2ea53ef87 (patch) | |
tree | 9baab29c015d6246c0a00e1d596c54ced0e7384b /sway/config.c | |
parent | 538b36c0e2f9f0bf64ef473789e2598ac7d1629f (diff) |
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.
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 12 |
1 files changed, 7 insertions, 5 deletions
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 <wlr/types/wlr_output.h> #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) { |