diff options
Diffstat (limited to 'sway/commands/output/dpms.c')
-rw-r--r-- | sway/commands/output/dpms.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/sway/commands/output/dpms.c b/sway/commands/output/dpms.c index 9d75a80e..c7adbd58 100644 --- a/sway/commands/output/dpms.c +++ b/sway/commands/output/dpms.c | |||
@@ -1,22 +1,8 @@ | |||
1 | #include "log.h" | ||
1 | #include "sway/commands.h" | 2 | #include "sway/commands.h" |
2 | #include "sway/config.h" | ||
3 | #include "util.h" | ||
4 | 3 | ||
5 | struct cmd_results *output_cmd_dpms(int argc, char **argv) { | 4 | struct cmd_results *output_cmd_dpms(int argc, char **argv) { |
6 | if (!config->handler_context.output_config) { | 5 | sway_log(SWAY_INFO, "The \"output dpms\" command is deprecated, " |
7 | return cmd_results_new(CMD_FAILURE, "Missing output config"); | 6 | "use \"output power\" instead"); |
8 | } | 7 | return output_cmd_power(argc, argv); |
9 | if (!argc) { | ||
10 | return cmd_results_new(CMD_INVALID, "Missing dpms argument."); | ||
11 | } | ||
12 | |||
13 | if (parse_boolean(argv[0], true)) { | ||
14 | config->handler_context.output_config->dpms_state = DPMS_ON; | ||
15 | } else { | ||
16 | config->handler_context.output_config->dpms_state = DPMS_OFF; | ||
17 | } | ||
18 | |||
19 | config->handler_context.leftovers.argc = argc - 1; | ||
20 | config->handler_context.leftovers.argv = argv + 1; | ||
21 | return NULL; | ||
22 | } | 8 | } |