What to run on Openbox startup
You’re going to want a few things to run on startup, most likely, and this is another area in which Blackbox and Fluxbox users will feel at home. Openbox uses the system autostart, located in
/etc/xdg/openbox by default, if there isn’t one in your profile (and there isn’t, unless you put one there). You can start with the default one (which I thought was a bit much) by copying that one, or just start with a blank file called “autostart.sh”, put it in
/~/.config/openbox, and make sure it has this at the top:
# Run the system-wide support stuff
Add items you want to start up after that line, and for things you want to keep running, you of course need to follow each line with an ampersand (“&”).
autostart.sh is very similar to my Fluxbox
startup file, but I did encounter some weirdness that needed some attention, and I’ll get to that in a minute.
First, here’s what my Openbox
/~/.config/openbox/autostart.sh looks like:
# Run the system-wide support stuff
# Programs to launch at startup
fbsetbg -r /home/trent/files/wallpaper/random
xscreensaver -no-splash &
# Load dockapps
(sleep 4 && wmcpuload -bl -lc blue) &
(sleep 4 && wmnetload -bl -lc blue) &
(sleep 6 && wmmemload -bl -lc blue) &
(sleep 7 && wmix) &
(sleep 7 && wmweather) &
(sleep 7 && wmacpi) &
# Programs that will run after Openbox has started
(sleep 2 && lxpanel) &
(sleep 2 && synergyc -f 192.168.1.100) &
And before you start scratching your head, allow me to explain some of this.
The first line is just to set a random wallpaper out of a local folder in which I have about a bazillion wallpaper images. Fluxbox users will recognize
fbsetbg as a handy wallpaper setting utility for Fluxbox; since I already had it on-hand on this laptop, and since it works just fine in Openbox as well, I utilize the same method here as I do in Fluxbox to set my wallpaper image.
nm-applet, being of course the network manager that I already have on Ubuntu. This is so that it starts the wifi stack and I can communicate with the network.
Next of course is my screensaver daemon, and
gnome-power-manager should be self-explanatory. I don’t like my touchpad enabled by default on my laptop, so I call the shell script I wrote to get around this annoying behavior a few weeks ago, so that it toggles the touchpad off on startup. The next line restores my sound levels to where I prefer them to be.
My dockapps were a completely different story. I found that I couldn’t just load them one after another in Openbox’s autostart like I could in Fluxbox. Doing so caused odd, random behavior for which I have only a limited explanation… I think for whatever reason, there needs to be a significant delay between the loading of each one of these dockapps, or they interfere with each other. Doing it without the “sleep” portion of each of those lines caused them to load in random orders, or sometimes just skipped entirely. This baffling behavior puzzled me for a couple of days. Finally, after experimenting with a variety of approaches and “sleep” values, I struck success with the above combination. Believe me when I say, any deviation from the way I have the dockapps section above causes things to not work correctly.
After my dockapps are started, I start LXPanel, which some of you may recognize as the default toolbar for LXDE. I chose this because I like to have a toolbar in my window manager (if nothing else to show me what windows I have open on any given desktop) and I actually like how LXPanel looks a lot more than one of the others I tried, one called fbpanel. LXPanel, like many elements in LXDE, can be run quite easily as a standalone app, and it works pretty well as a toolbar for Openbox.
The last line starts up the Synergy client on my laptop so that when I have it running next to my desktop machine, I can easily work back and forth without switching to the laptop keyboard and mouse.