aboutsummaryrefslogtreecommitdiff
path: root/sway/config
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config')
-rw-r--r--sway/config/output.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index 68022278..ee2440ea 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -81,6 +81,9 @@ void merge_output_config(struct output_config *dst, struct output_config *src) {
free(dst->background_option);
dst->background_option = strdup(src->background_option);
}
+ if (src->dpms_state != 0) {
+ dst->dpms_state = src->dpms_state;
+ }
}
static void set_mode(struct wlr_output *output, int width, int height,
@@ -204,6 +207,20 @@ void apply_output_config(struct output_config *oc, struct sway_container *output
execvp(cmd[0], cmd);
}
}
+ if (oc && oc->dpms_state != DPMS_IGNORE) {
+ switch (oc->dpms_state) {
+ case DPMS_ON:
+ wlr_log(L_DEBUG, "Turning on screen");
+ wlr_output_enable(wlr_output, true);
+ break;
+ case DPMS_OFF:
+ wlr_log(L_DEBUG, "Turning off screen");
+ wlr_output_enable(wlr_output, false);
+ break;
+ case DPMS_IGNORE:
+ break;
+ }
+ }
}
void free_output_config(struct output_config *oc) {