2

I've tried a lot of things. I googled and followed tutorials and I'm still unable to have my wallpaper load on startup.

What I've done so far is I've added the wallpaper of my choice via feh

feh --bg-scale /home/MYNAME/Pictures/wallpaper123.jpg. This set's my wallpaper just fine.

Obviously after restart, the wallpaper is not loaded. So I followed some tutorials that had me do the following

I added this code #My wallpaper eval cat $HOME/.fehbg & to the autostart.sh file in /etc/xdg/openbox.

Well, when I restart, my wallpaper is never loaded.

I also tried adding a directory called "Wallpapers". I then copied the following code

 #!/bin/env bash
 WALLPAPERS="/home/yourUserName/wallpapers"
 ALIST=( `ls -w1 $WALLPAPERS` )
 RANGE=${#ALIST[@]}
 let "number = $RANDOM"
 let LASTNUM="`cat $WALLPAPERS/.last` + $number"
 let "number = $LASTNUM % $RANGE"
 echo $number > $WALLPAPERS/.last

 feh --bg-scale $WALLPAPERS/${ALIST[$number]}

into a file called wallpaper.sh and saved it at ~/.config/openbox/

I ran chmod +x wallpaper.sh

and added

#Random wallpaper
./pathFromHome/wallpaper.sh

to my autostart.sh file.

Still, nothing.

What am I doing wrong?

2
  • ~/.config/openbox/autostart (without .sh) it is executed as a shell script on startup (doesn't need +x)
    – Alex
    Apr 22, 2014 at 22:20
  • Sorry, I'm not sure what you are trying to say. Apr 23, 2014 at 4:23

2 Answers 2

1

The mistake I was making was creating the wallpaper.sh file in ~/.config/openbox/

I should have only created a file called autostart.sh or autostart (either work for me) inside ~/.config/openbox/ and in that file I simply write feh --bg-scale /home/myusername/Pictures/nameOfPicture.png

I then save and close. After restarting, the wallpaper of my choice is displayed at startup.

EDIT

Very important..

Do not forget to add & at the end of script, like I did just now.

So the updated autostart should look like this

feh --bg-scale /home/myusername/Pictures/nameOfPicture.png &

Forgetting to do so means that when openbox starts, it will execute the above but without the & that might be the only thing it executes and nothing else.

0

You are doing it wrong; very wrong. Do not create any exec scripts. https://wiki.archlinux.org/index.php/openbox#Wallpaper_.2F_background_programs

1
  • Oh shoot. Is it because I forgot to add & at the end? I've reviewed what you linked a few times and the only discrepancy with the link's use of feh is the & at the end of the autostart file. I remember reading about how it's important to have that or otherwise everything else will not execute without the &. I will fix this right now. If there is anything else that I'm doing wrong, please let me know and if you can, more specifically. Thank's a lot. Apr 23, 2014 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .