aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2022-06-23 21:03:32 +0200
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2022-07-04 21:58:24 +0300
commitb69d637f7a34e239e48a4267ae94a5e7087b5834 (patch)
tree63e33a9a15a08c5ebe9bf68183a10bad86997ce7 /sway/commands
parentconfig.in: switch to `output power` (diff)
downloadsway-b69d637f7a34e239e48a4267ae94a5e7087b5834.tar.gz
sway-b69d637f7a34e239e48a4267ae94a5e7087b5834.tar.zst
sway-b69d637f7a34e239e48a4267ae94a5e7087b5834.zip
Remove internal references to DPMS
While at it, use an int for the config field, just like we do for all other fields.
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/output/power.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/commands/output/power.c b/sway/commands/output/power.c
index c783e69b..e6ae2852 100644
--- a/sway/commands/output/power.c
+++ b/sway/commands/output/power.c
@@ -12,7 +12,7 @@ struct cmd_results *output_cmd_power(int argc, char **argv) {
12 return cmd_results_new(CMD_INVALID, "Missing power argument"); 12 return cmd_results_new(CMD_INVALID, "Missing power argument");
13 } 13 }
14 14
15 enum config_dpms current_dpms = DPMS_ON; 15 bool current = true;
16 if (strcasecmp(argv[0], "toggle") == 0) { 16 if (strcasecmp(argv[0], "toggle") == 0) {
17 const char *oc_name = config->handler_context.output_config->name; 17 const char *oc_name = config->handler_context.output_config->name;
18 if (strcmp(oc_name, "*") == 0) { 18 if (strcmp(oc_name, "*") == 0) {
@@ -27,14 +27,14 @@ struct cmd_results *output_cmd_power(int argc, char **argv) {
27 } 27 }
28 28
29 if (sway_output->enabled && !sway_output->wlr_output->enabled) { 29 if (sway_output->enabled && !sway_output->wlr_output->enabled) {
30 current_dpms = DPMS_OFF; 30 current = false;
31 } 31 }
32 } 32 }
33 33
34 if (parse_boolean(argv[0], current_dpms == DPMS_ON)) { 34 if (parse_boolean(argv[0], current)) {
35 config->handler_context.output_config->dpms_state = DPMS_ON; 35 config->handler_context.output_config->power = 1;
36 } else { 36 } else {
37 config->handler_context.output_config->dpms_state = DPMS_OFF; 37 config->handler_context.output_config->power = 0;
38 } 38 }
39 39
40 config->handler_context.leftovers.argc = argc - 1; 40 config->handler_context.leftovers.argc = argc - 1;