diff options
Diffstat (limited to 'sway/config')
-rw-r--r-- | sway/config/output.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index 504c48c6..1d8cb3ef 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -77,6 +77,10 @@ void merge_output_config(struct output_config *dst, struct output_config *src) { | |||
77 | free(dst->background_option); | 77 | free(dst->background_option); |
78 | dst->background_option = strdup(src->background_option); | 78 | dst->background_option = strdup(src->background_option); |
79 | } | 79 | } |
80 | if (src->background_fallback) { | ||
81 | free(dst->background_fallback); | ||
82 | dst->background_fallback = strdup(src->background_fallback); | ||
83 | } | ||
80 | if (src->dpms_state != 0) { | 84 | if (src->dpms_state != 0) { |
81 | dst->dpms_state = src->dpms_state; | 85 | dst->dpms_state = src->dpms_state; |
82 | } | 86 | } |
@@ -226,17 +230,19 @@ void apply_output_config(struct output_config *oc, struct sway_container *output | |||
226 | wlr_log(WLR_DEBUG, "Setting background for output %d to %s", | 230 | wlr_log(WLR_DEBUG, "Setting background for output %d to %s", |
227 | output_i, oc->background); | 231 | output_i, oc->background); |
228 | 232 | ||
229 | size_t len = snprintf(NULL, 0, "%s %d %s %s", | 233 | size_t len = snprintf(NULL, 0, "%s %d %s %s %s", |
230 | config->swaybg_command ? config->swaybg_command : "swaybg", | 234 | config->swaybg_command ? config->swaybg_command : "swaybg", |
231 | output_i, oc->background, oc->background_option); | 235 | output_i, oc->background, oc->background_option, |
236 | oc->background_fallback ? oc->background_fallback : ""); | ||
232 | char *command = malloc(len + 1); | 237 | char *command = malloc(len + 1); |
233 | if (!command) { | 238 | if (!command) { |
234 | wlr_log(WLR_DEBUG, "Unable to allocate swaybg command"); | 239 | wlr_log(WLR_DEBUG, "Unable to allocate swaybg command"); |
235 | return; | 240 | return; |
236 | } | 241 | } |
237 | snprintf(command, len + 1, "%s %d %s %s", | 242 | snprintf(command, len + 1, "%s %d %s %s %s", |
238 | config->swaybg_command ? config->swaybg_command : "swaybg", | 243 | config->swaybg_command ? config->swaybg_command : "swaybg", |
239 | output_i, oc->background, oc->background_option); | 244 | output_i, oc->background, oc->background_option, |
245 | oc->background_fallback ? oc->background_fallback : ""); | ||
240 | wlr_log(WLR_DEBUG, "-> %s", command); | 246 | wlr_log(WLR_DEBUG, "-> %s", command); |
241 | 247 | ||
242 | char *const cmd[] = { "sh", "-c", command, NULL }; | 248 | char *const cmd[] = { "sh", "-c", command, NULL }; |