From 039c4346b1ce414d96f3b019e9dd82f14817ca21 Mon Sep 17 00:00:00 2001 From: Jason Nader Date: Thu, 18 Nov 2021 23:16:48 +0900 Subject: [PATCH] Do not default to `off` to dpms command --- sway/commands/output/dpms.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sway/commands/output/dpms.c b/sway/commands/output/dpms.c index 638c0aded..6e4402656 100644 --- a/sway/commands/output/dpms.c +++ b/sway/commands/output/dpms.c @@ -35,8 +35,11 @@ struct cmd_results *output_cmd_dpms(int argc, char **argv) { if (parse_boolean(argv[0], current_dpms == DPMS_ON)) { config->handler_context.output_config->dpms_state = DPMS_ON; - } else { + } else if (strcmp(argv[0], "off") == 0) { config->handler_context.output_config->dpms_state = DPMS_OFF; + } else { + return cmd_results_new(CMD_INVALID, + "Invalid dpms argument: %s", argv[0]); } config->handler_context.leftovers.argc = argc - 1;