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
parent c9cb5ced7f
commit ec3d66de28
6 changed files with 63 additions and 26 deletions

View file

@ -478,6 +478,8 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
binding->flags |= BINDING_LOCKED;
} else if (strcmp("--no-warn", argv[0]) == 0) {
warn = false;
} else if (strcmp("--reload", argv[0]) == 0) {
binding->flags |= BINDING_RELOAD;
} else {
break;
}