LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   can't seem to make wallpaper permanent in feh (https://www.linuxquestions.org/questions/linux-software-2/cant-seem-to-make-wallpaper-permanent-in-feh-4175679943/)

burning 08-05-2020 09:28 AM

can't seem to make wallpaper permanent in feh
 
I'm running dwm as my window manager.
I've appended ~/.fehbg & to my ~/.xinitrc file and the contents of my ~/.fehbg file reads:
Code:

#!/bin/sh
feh --no-fehbg --bg-scale '/pathtoimage'

And this is the contents of my ~/.xinitrc:
Code:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi

# Start the window manager:
exec /usr/bin/dwm

# Start the desktop wallpaper application:
~/.fehbg &


but the image won't load automatically on the startup of my xsession. I have to enter feh --bg-scale /pathtoimage every time.

The image in question doesn't have any capital letters or spaces in its name so I don't think I entered the incorrect image name.

Any idea why it's not loading automatically on startup of the Xsession?

sevendogsbsd 08-05-2020 10:45 AM

Silly question but is ~/.fehbg marked executable? I always had to do this when this was my set up.

Shadow_7 08-05-2020 11:33 AM

I just use xsetbg

$ xsetbg image.file

Or I get lazy and use xsetroot

$ xsetroot -solid rgb:00/00/00

$ xsetroot -solid Blue4

ondoho 08-05-2020 02:07 PM

Quote:

Originally Posted by burning (Post 6152892)
Code:

~/.fehbg &
exec /usr/bin/dwm


FTFY.

sevendogsbsd 08-05-2020 02:36 PM

Ah yes, I missed the forest for the trees: the exec line needs to be last.

burning 08-05-2020 08:09 PM

Quote:

Originally Posted by ondoho (Post 6152975)
FTFY.

Ah, thanks! Do you know why executing the window manager needs to be last?

ondoho 08-06-2020 03:15 AM

Because 'exec' ends the script. Nothing after that is executed anymore (well there's exceptions to that, but in this case it is true enough).

burning 08-06-2020 11:45 AM

Quote:

Originally Posted by ondoho (Post 6153133)
Because 'exec' ends the script. Nothing after that is executed anymore (well there's exceptions to that, but in this case it is true enough).

Ah, thanks!


All times are GMT -5. The time now is 11:49 AM.