Skip to content
Snippets Groups Projects
Commit 3e284a9a authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Merge branch 'SirCmpwn-master'

parents 2b04e7f4 821a0996
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ...@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "options.h" #include "options.h"
#include "wallpaper.h" #include "wallpaper.h"
#include <limits.h> #include <limits.h>
#include <sys/stat.h>
Window ipc_win = None; Window ipc_win = None;
Window my_ipc_win = None; Window my_ipc_win = None;
Atom ipc_atom = None; Atom ipc_atom = None;
...@@ -450,12 +451,17 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, ...@@ -450,12 +451,17 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
if (home) { if (home) {
FILE *fp; FILE *fp;
char *path; char *path;
struct stat s;
path = estrjoin("/", home, ".fehbg", NULL); path = estrjoin("/", home, ".fehbg", NULL);
if ((fp = fopen(path, "w")) == NULL) { if ((fp = fopen(path, "w")) == NULL) {
weprintf("Can't write to %s", path); weprintf("Can't write to %s", path);
} else { } else {
fprintf(fp, "%s\n", fehbg); fprintf(fp, "#!/bin/sh\n%s\n", fehbg);
fclose(fp); fclose(fp);
stat(path, &s);
if (chmod(path, s.st_mode | S_IXUSR | S_IXGRP) != 0) {
weprintf("Can't set %s as executable", path);
}
} }
free(path); free(path);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment