Example Openbox desktop with the XFCE4 Panel,
OBmenu, and Conky system monitor.
Click image for larger view.
Raspberry Pi Openbox Desktop Setup
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!
First we add user pi to various groups to access sudo, USB, audio, etc. if you haven't already:
~ $ sudo su your_password ~ $ adduser pi root ~ $ adduser pi sudo ~ $ adduser pi audio ~ $ adduser pi dialout ~ $ adduser pi video ~ $ adduser pi games ~ $ adduser pi netdev ~ $ adduser pi users
Let's assume the user is pi. Open this folder and add the following as root:
~ $ leafpad /etc/sudoers
You should see something like this - add what isn't there:
# User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo # to execute any command %sudo ALL=(ALL:ALL) ALL # add this below pi ALL=(ALL) NOPASSWD: ALL
Save and close leafpad. This gives user pi sudo access without having to type in a password with sudo every time. Type reboot (enter) to reboot RPi, log back in. Open a terminal, then type "sudo su" and you should be logged in as root if everything worked.
Date April 26, 2019. Due to changes in the newest Raspbian I've deleted this section. Do not tamper with FSTAB or it will wreck your system.
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.
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
- Software and setup:
- Raspberry Pi Openbox Desktop 2019
- Raspberry Pi USB Audio Connection 2019
- Raspberry Pi Screen Shots with Scrot
- Raspberry Pi Window Manager Control with Xinitrc
- Raspberry Pi uses FEH Desktop Backgrounds
- Zmixer ALSA Sound Control to Raspberry Pi
- Beaver Text Editor to Raspberry Pi
- Viewnior Lightweight Image Viewer for Raspberry Pi
- Connecting DS1307 RTC to Raspberry Pi
- Setup JWM Window Manager for Raspberry Pi
- Setting up Openbox for Raspberry Pi
- Web Master
- Bristol VA/TN
- US Constitution
- Religious Themes
- Religion Archive 1
- Gen. Electronics
- YouTube Channel
- Arduino Projects
- Raspberry Pi & Linux
- PIC18F2550 in C
- PIC16F628A Assembly
- PICAXE Projects
- WiringPi and Pulse-Width-Modulation with Raspberry Pi
- WiringPi for Raspberry Pi and MAX6675 thermal-couple sensor
- WiringPi Blink an LED Demo
- Interface I2C LCD to Raspberry Pi in C
- ADS1115 4-Channel ADC Uses I2C with Raspberry Pi
- MCP4725 12-Bit DAC Interface to Raspberry Pi
- Raspberry Pi with PCF8591 Analog To Digital Control in C
- Raspberry Pi PCF8591 AD-DA Sensor Python Interface