diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-07-24 19:23:04 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 19:23:04 +1000 |
commit | e02a6718c2c7313309b45e499034d614ee6207fc (patch) | |
tree | 429de47906f0ba1f114689c48cbabc5be8bb6e71 /sway/commands/output | |
parent | 94dd8823a0081f7983dce368d5d093d1d3eeaefe (diff) | |
parent | 6ccf2a2c66c1264450a4b3ab3dd344e1b3b44ca3 (diff) |
Merge branch 'master' into mouse-bindings
Diffstat (limited to 'sway/commands/output')
-rw-r--r-- | sway/commands/output/dpms.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/commands/output/dpms.c b/sway/commands/output/dpms.c index 0959ea6b..3492061e 100644 --- a/sway/commands/output/dpms.c +++ b/sway/commands/output/dpms.c @@ -1,5 +1,6 @@ #include "sway/commands.h" #include "sway/config.h" +#include "util.h" struct cmd_results *output_cmd_dpms(int argc, char **argv) { if (!config->handler_context.output_config) { @@ -9,13 +10,10 @@ struct cmd_results *output_cmd_dpms(int argc, char **argv) { return cmd_results_new(CMD_INVALID, "output", "Missing dpms argument."); } - if (strcmp(*argv, "on") == 0) { + if (parse_boolean(argv[0], true)) { config->handler_context.output_config->dpms_state = DPMS_ON; - } else if (strcmp(*argv, "off") == 0) { - config->handler_context.output_config->dpms_state = DPMS_OFF; } else { - return cmd_results_new(CMD_INVALID, "output", - "Invalid dpms state, valid states are on/off."); + config->handler_context.output_config->dpms_state = DPMS_OFF; } config->handler_context.leftovers.argc = argc - 1; |