Openbox with Rox Pinboard screen shot
Example Openbox desktop with the XFCE4 Panel,
OBmenu, and Conky system monitor.
Click image for larger view.

Raspberry Pi Openbox Desktop Setup

by Lewis Loflin

Note I'm dealing only with Debian based distributions in particular in the Raspberry Pi. This will work for other Debian based distributions when starting from the command line startx based on your .xinitrc file. If you haven't installed Openbox already then:

sudo apt-get install openbox obconf menu obmenu conky parcellite feh rox-filer tint2 xfce4-panel

If one has a regular Debian distribution on a PC with a display manager such as lightdm and have installed Openbox select Openbox from the menu then log in.

Note .xinitrc doesn't work with a display manager!


Openbox obmenu program.
Openbox obmenu program.

Setting Up Openbox Menu

This is called the Openbox desktop and from here we will construct our own fast operating system. What do we really need? Right click the mouse and a small selection box comes up with a terminal program and web browser (Midori) and little else.

At this point we are going to add these items to the menu in order to learn how to setup the menu and get direct access to those programs. Let's add those items already installed to the menu first and add more later.

Open the terminal and I'm assuming you logged in as root. Type obmenu (enter) and we can now open Obmenu as shown above. The top bar should say "Obmenu /root/.config/openbox/menu.xml". Click on "Openbox 3" to open the main menu.

Put the dark bar below the terminal and web browser and select "New Item" and put in:

Label - PcmanFM ; Execute - pcmanfm and once again select "New Item" and do the same for the following:

Label - Leafpad ; Execute leafpad ; etc. whatever programs you want to enter.

Now save and right click on the menu "restart" and the now items you entered are in the menu. You should also see "Debian" if menu was installed and opens up to a number of other small programs.

Pcmanfm is a file manager that came with LXDE and leafpad is a text editor. As one adds new programs they can return here to add those to the menu.

If one is in their home directory (which is where you should be if not root) the top black bar will have "~/.config/openbox/menu.xml".

This can also be done from a text editor in order to add small icons:

$ sudo leafpad ~/.config/openbox/menu.xml

And this is a sample where "label" and "execute is what you entered with Obmenu. (This example uses thunar.)


<item icon="/usr/share/icons/thunar.png" label="Thunar">
			<action name="Execute">
				<execute>thunar</execute>
			</action>
		</item>

Here is great screen shot of my Openbox menu: sshot3.png and that pre-made menu can be downloaded via wget and will need some editing unless one is following this entire series.

$ sudo mv ~/.config/openbox/menu.xml ~/.config/openbox/menu_bak.xml
$ sudo wget http://www.bristolwatch.com/rpi/dl/menu.xml
$ sudo cp menu.xml ~/.config/openbox

What one did above was rename the old menu.xml, downloaded the replacement, then copied it to ~/.config/openbox.

Closer view of menu click here. To view XFCE menu click here.



How to Configure Openbox

This assumes the following programs have been installed if not do so now.

~ $sudo apt-get tint3, xfce4-panel, feh, parcellite, conky, rox-filer

When Openbox loads it will run the file "autostart" in the "~/.config/openbox" folder if not over ridden by .xinitrc. Open a terminal and:

$ leafpad ~/.config/openbox/autostart

Copy what's below and uncomment what you want and save.


#start up for openbox
# uncomment what you want if not selected from .xinitrc
# this assumes these programs are installed
# wallpaper -
sh ~/.fehbg & 

#bottom tray/bar choose only 1
#exec tint2 &
#exec xfcer4-panel &

# clipboard
#exec parcellite &

# system monitor
#exec conky & 

#rox-filer pinboard. If using with conky set both to same background
# may not work with conky
#exec rox --pinboard=pblewis &

$ sudo chmod +x autostart

This will work if one doesn't have a .xinitrc file over riding it. To find out more see Raspberry Pi Window Manager Control with Xinitrc



YouTube Videos:
MCP4725 12-Bit DAC Interface to Raspberry Pi
ADS1115 4-Channel ADC Uses I2C with Raspberry Pi
Interface I2C LCD to Raspberry Pi in C
Pulse-Width-Modulation with Raspberry Pi
Using Geany Text editor C Programming
Raspberry Pi Blink Demo
MAX6675 Raspberry Pi Demo

Videos:
Raspberry Pi, Arduino, and Learning Linux
Raspberry PI Arduino Advanced Interface
Tkinter with Raspberry Pi and PCF8591 AD-DA Sensor

Linux Videos

Live Linux Distro for Using Printer Port with Electronics
Using the powerful Rox-Filer system in Linux
Use FEH under Linux for a Wallpaper Setter
How to create Symbolic links in Linux