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.
This commit is contained in:
Brian Ashworth 2019-07-09 02:57:59 -04:00 committed by Simon Ser
parent 538b36c0e2
commit 152e30c374
6 changed files with 63 additions and 26 deletions

View file

@ -39,6 +39,7 @@ enum binding_flags {
BINDING_CONTENTS=8, // mouse only; trigger on container contents
BINDING_TITLEBAR=16, // mouse only; trigger on container titlebar
BINDING_CODE=32, // keyboard only; convert keysyms into keycodes
BINDING_RELOAD=62, // switch only; (re)trigger binding on reload
};
/**

View file

@ -4,16 +4,20 @@
#include "sway/input/seat.h"
struct sway_switch {
struct sway_seat_device *seat_device;
struct sway_seat_device *seat_device;
enum wlr_switch_state state;
enum wlr_switch_type type;
struct wl_listener switch_toggle;
struct wl_listener switch_toggle;
};
struct sway_switch *sway_switch_create(struct sway_seat *seat,
struct sway_seat_device *device);
struct sway_seat_device *device);
void sway_switch_configure(struct sway_switch *sway_switch);
void sway_switch_destroy(struct sway_switch *sway_switch);
void sway_switch_retrigger_bindings_for_all(void);
#endif