Raspberry Pi 3

Raspberry Pi Openbox Desktop 2019

by Lewis Loflin

The original Raspberry Pi computer came out February 29, 2012. The Pi 1 was a sensation. Today we have the Raspberry Pi Model 3 + shown above.

It is a massive improvement in computing power and features. It is still priced at $35. 14 to 15 million of all types have been sold. Wikipedia has an excellent history on the Raspberry Pi.

Here I'll address the Pi 2 and 3. The Pi 2 lacks wireless and Bluetooth. This will evolve around the Openbox desktop. I'll use the rox-filer pinboard in conjunction with openbox as shown above.

I will make heavy use a bash script and Pyhon3-tk for graphics. The goal is to learn Linux desktops for speed and function. I will not deal with bloated or inflexible KDE or Gnome.

Openbox desktop

While the newer versions are more powerful they still suffer some pitfalls due to keeping the price down.

There is no hard drive instead using a Micro SD card to store data and the operating system. I'm very wary of those due to limited read-write cycles. Get a higher quality card. I'll assume the reader can program their own or buy it.

For backup of programs I use a 64-Gig Lexar USB 3 thumb drive. I'll go into using that and even how to connect an external hard drive for data backup.

It lacks a real time clock that we will see how to install. If connected to the internet a hardware clock isn't needed, but I want one.

For this I use the official Raspbian with desktop, not the other bloated version with Libreoffice, kiddie software, etc. It come with a basic LXDE desktop Linux system.

This is a vast improvement over the original versions. On my Raspberry Pi 2 it found my D-Link USB wireless adaptor with no problem. It included WiringPi to access the GPIO pins already installed. I2C, one-wire, etc. can be activated from a menu.

The goal is to create fully functional desktop style Linux PC. Raspbian is based on Debian. I will be able to use the parts of LXDE in the new system or revert right back to the original.

Underneath LXDE is Openbox. I'll add useful additions and hake the system configurable with a single mouse click. The idea is to eliminate slow software for a faster, more flexible system.

The idea is to learn Linux, bash, python, C, and C++. How to configure different systems and programming the hardware GPIO pins. I'll be making heavy use of bash script and python popup boxes.

Raspberry Pi 3

Initial Setup

The first thing to do is take total control of the system. In the menu go down to preferences, Raspberry Pi Configuration, and open the above box. Check "To CLI" to boot to the command line. One will be logged in as Pi simply type "startx" and system will operate as before.

While here reset your password and under interfaces check off i2c, one wire, etc. or whatever you plan to use. Close out the box.

As it is when "startx" is entered it does the same as before. One must add a file .xinitrc into your home directory Pi. Startx will use this file to configure the system. If missing it defaults back to the original LXDE.

Caution: you can create system chaos if .xinitrc isn't set up properly! I'll explain this more fully in a moment. First we must download and install some programs.

Open a terminal window and do the following:

pi@raspberrypi:~ $ sudo apt-get update

Wait for it to finish and download the following: rox-filer, feh, apt-file, openbox, tint2, nano, obmenu, scrot, clipit, aterm, locate, mpg123, menu, i2c-tools, python-smbus. Download more than one at a time don't use commas! For example:

pi@raspberrypi:~ $ sudo apt-get install rox-filer feh openbox tint2 etc.

The xfce4-panel is optional. It does what the native lxpanel does but list programs missing from lxpanel.

This very simple version of .xinitrc will get you started with Raspberry Pi Openbox. Then we can build from there. The LXpanel works as before.

Copy the following to a file in a text editor as ".xinitrc" and save in your home directory.

# ~/.xinitrc
# Executed by startx
exec lxpanel &
exec openbox 

You get you original panel at the top and Openbox desktop. You will not get the Rox pinboard. In the following pages we will grow to a full system.