aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c
index ce6d8baf..2c9cc290 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -314,6 +314,28 @@ void apply_output_config(struct output_config *oc, swayc_t *output) {
314 } 314 }
315 output->x = x; 315 output->x = x;
316 } 316 }
317
318 if (oc->background) {
319 int i;
320 for (i = 0; i < root_container.children->length; ++i) {
321 if (root_container.children->items[i] == output) {
322 break;
323 }
324 }
325
326 sway_log(L_DEBUG, "Setting background for output %d to %s", i, oc->background);
327 char *cmd = malloc(
328 strlen("swaybg ") +
329 (i >= 10 ? 2 : 1) +
330 strlen(oc->background) + 3 +
331 strlen(oc->background_option) + 3 +
332 1);
333 sprintf(cmd, "swaybg %d '%s' '%s'", i, oc->background, oc->background_option);
334 if (fork() == 0) {
335 execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL);
336 }
337 free(cmd);
338 }
317} 339}
318 340
319char *do_var_replacement(char *str) { 341char *do_var_replacement(char *str) {