I have a script called
display, which sets my desktop background using
feh. It does so with the following line:
feh --bg-scale $WALLPAPER &
The environment variable $WALLPAPER is initialized in my
.bashrc. The script works correctly if I execute it from an ordinary shell after login.
I want the script to be executed by i3 on startup. Therefore, I added the following line to
and it doesn't work. I tried to redirect STDERR to a file, and the result is:
feh: No loadable images specified. See 'man feh' for detailed usage information
Moreover, if I try to
echo $WALLPAPER inside
display, I get a blank line. So the environment variable is not initialized yet. Fine - I tried to add
exec /bin/bash -c "source ~/.bashrc" on the line above, but that seems to make no difference. How can I make sure this variable is initialized when i3 starts up?