summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-02-08 17:58:21 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-02-08 17:58:21 +0100
commit553d6f9060d867cf05bd21d8669751b31bbe11dd (patch)
tree8b0a884d6923b73e02a3270a9383ce53a05f00c9 /src
parent444a28c3d0ef6618a3b674466a241456a5d7d534 (diff)
Fix ~/.fehbg creation when using --randomize or directory arguments
Closes #456 Note that --randomize and directory names are not saved in fehbg. It only contains the command line needed to recreate the wallpaper setup which resulted from its invocation, i.e., after randomization etc. have been applied. This is intentional.
Diffstat (limited to 'src')
-rw-r--r--src/wallpaper.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/wallpaper.c b/src/wallpaper.c
index ef7ecca..f0bf891 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -502,15 +502,16 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
}
fputc(' ', fp);
if (use_filelist) {
- for (int i = 0; i < cmdargc; i++) {
- if (filelist_pos && !strcmp(FEH_FILE(filelist_pos->data)->filename, cmdargv[i])) {
- /* argument is a file */
- absolute_path = feh_absolute_path(cmdargv[i]);
- fputs(shell_escape(absolute_path), fp);
- filelist_pos = filelist_pos->next;
- free(absolute_path);
- fputc(' ', fp);
- }
+#ifdef HAVE_LIBXINERAMA
+ for (int i = 0; (i < num_xinerama_screens) && filelist_pos; i++) {
+#else
+ for (int i = 0; (i < 1 ) && filelist_pos; i++) {
+#endif
+ absolute_path = feh_absolute_path(FEH_FILE(filelist_pos->data)->filename);
+ fputs(shell_escape(absolute_path), fp);
+ filelist_pos = filelist_pos->next;
+ free(absolute_path);
+ fputc(' ', fp);
}
} else if (fil) {
absolute_path = feh_absolute_path(fil);