Tutorial Xinitrc Desktop Manager Control for Linux
by Lewis Loflin
(Above) Openbox Desktop with Idesk and WBAR quick launch icons, Conky system monitor, and Tint2 taskbar.
The background is set by FEH. The Audio and desktop Python select boxes are separate.
Update September 2020. Some versions of Raspbian for the Raspberry Pi doesn't have a file .xinitrc so you have to create it.
The purpose is to introduce one to using Xinitrc to configure desktop environments. I'll present several examples.
The examples work on regular PCs and Raspberry Pi.
This was originally oriented towards Raspberry Pi a popular single-boards computer. See Raspberry Pi Openbox Desktop 2020
It uses an ARM version of Debian Linux. What works on a Raspberry Pi desktop will normally work on standard PC using Debian Linux.
I have a number of older personal computers I use for electronics control and practice programming. I want a fast, functional desktop I control and configure. I also want to use the same setup across multiple type machines.
Thus I use "lite" Linux distributions. On this website I'll looking at Openbox, Fluxbox, FLWM, JWM, and PEK. I can run all on same machine (not at the same time) by using using a single file to configure.
A file proceeded by a "." is hidden unless the file manager is set to show hidden files.
This hidden file .xinitrc is placed in one's home folder. This operates from the command line login. It is ignored when using a graphical login manager.
It constructs your desktop environment, what window manager to use, and what pin boards, panels, icon setters, wallpaper, etc. will appear.
Type startx and the system will search for a file the .xinitrc in your home folder.
This assumes the correct software is already installed and configured. For this I'll assume Raspberry Pi with its version of Debian 10 or Buster.
LXDE which comes installed on Raspberry Pi. It can be installed from a Debian CD to a PC. LXDE means "Lightweight X11 Desktop Environment". A "desktop environment" includes underlying X11 software that operates the video hardware. A window manager creates "windows" and is "on top" of the X11 then everything else is mixed in such as pin boards, panels, etc.
LXDE, XFCE, KDE, etc. are desktop environments. So LXDE consists of the LXpanel-taskbar with menu, clock, and program icons. The background-pin board is the PCmanfm file manager, and all is built on top of the Openbox window manager. Or should I say a version of it.
I'll install or start with LXDE then then add whatever else I want.
sudo apt-get update
If LXDE is installed then lxpanel, volti, clipit, pcmanfm for pinboard, and a variation of openbox are already in the system. At least on a Raspberry Pi.
So I'll install alternate window managers including full openbox:
pi@raspberrypi:~ $ sudo apt-get install openbox menu obmenu jwm pekwm fluxbox flwm
All of these window managers are just that. Openbox, pekwm, and flwm are barren black screens with a very limited menu.
JWM and fluxbox also have limited menus but come with their taskbars-panels.
Simply install the ones you want.
Non-LXDE openbox differs somewhat from regular openbox. Obmenu and menu work with all versions.
Next we need some taskbars-panels. Let's look at a few.
This is a close up view of the lxpanel. Includes popup menu (under the raspberry), clock, tray volume control (volti), parcellite clipboard manager, and blue tooth and wireless control icons. This is from Raspberry Pi LXDE. I added parcellite.
The three quick-launch icons on the left for web browser, file manager, and terminal.
This is FBpanel that includes popup menu under the Debian symbol, three quick-launch icons, assorted system monitors, volti, parcellite, clock.
pi@raspberrypi:~ $ sudo apt-get install fbpanel, volti, parcellite
This is the XfCE4-panel from the XFCE Desktop. Has popup menu, clock, parcellite, and volti. It is easy to add quick-launch icons.
pi@raspberrypi:~ $ sudo apt-get install xfce4-panel, volti, parcellite
Tint2 above has no popup menu. I has three quick-launch icons, parcellite, volti, clock.
pi@raspberrypi:~ $ sudo apt-get install tint2, volti, parcellite
The first three their menus work as is for the most part.
Pcmanfm file manager comes with Raspberry Pi LXDE desktop. It also doubles as desktop manager with LXDE. It also comes with LXpanel that can be used with another window manager such as Openbox.
Above is WBAR. It can be programmed for top, bottom, left, right. See Setting up WBAR.
FEH is used to set the desktop wallpaper. This is seen when no pin board is used. See Using FEH.
Rox-Filer is a drop-drag file manager. It also creates "strips" for quick-launch icons or a pinboard for quick-launch icons.
Idesk is a icon setter for the Linux desktop. Don't use with rox-filer or pcmanfm pinboards.
pi@raspberrypi:~ $ sudo apt-get install rox-filer conky feh idesk wbar
This is what .xinitrc would be for the desktop at the top of the page.
Note that except for the window manager command at the end everything must be followed by a "&". This tells Linux these programs operate in the background.
#!/bin/sh # ~/.xinitrc #wallpaper sh ~/.fehbg & exec tint2 & parcellite & (sleep 4s && conky) & volti & # wbar must be installed and configured (sleep 2s && wbar) & # don't use with rox pinboard (sleep 2s && idesk) & exec openbox-session
Above is an example of the Fluxbox desktop. I added FEH wallpaper, conky system monitor, Rox-Filer strip.
Fluxbox has its own built-in taskbar.
#!/bin/sh # ~/.xinitrc # Executed by startx (run your window manager from here) #wallpaper sh ~/.fehbg & #This is a panel strip for the top or bottom rox --top=myp2 & parcellite & (sleep 4s && conky) & volti & #when you start fluxbox in your ~/.xinitrc, use 'startfluxbox' instead of fluxbox. #exec startfluxbox exec fluxbox
Above is the PEKwm desktop with FBpanel and the Rox-Filer pinboard.
#!/bin/sh # ~/.xinitrc # Executed by startx (run your window manager from here) rox --pinboard=pblewis & fbpanel & parcellite & volti & exec pekwm
Finally above is the Openbox-LXDE desktop. It has the Rox-Filer strip, Conky system monitor, and Lxpanel. I'll use lxde version of openbox.
There are three variations of openboxlxde that produce differing looks on the LXpanel. The panel call volti and the system clipit.
This was configured for a Raspberry Pi Model 4.
#!/bin/sh # ~/.xinitrc # Executed by startx (run your window manager from here) if [ -d /etc/X11/xinit/xinitrc.d ]; then for f in /etc/X11/xinit/xinitrc.d/*; do [ -x "$f" ] && . "$f" done unset f fi #wallpaper sh ~/.fehbg & #This is a panel strip for the top or bottom or top rox --top=myp2 & lxpanel --profile LXDE-pi & (sleep 4s && conky) & parcellite & # if using this comment out volti, clipit /usr/bin/startlxde-pi #alternate lxpanel no clipit #openbox desktop #/usr/bin/openbox-lxde-pi #/usr/bin/startlxde
On my computer website:
- Exploring Digital Computer Electronics
- Presario 1999 CM1001 Gaming Computer Salvage
- Salvage, Test 2012 AAEON EMB-B75A Industrial Motherboard
- Hardware Review Connecting PC Parallel Ports
- Main Light Fast Linux Desktops with Openbox, JWM
- Test Reuse Surplus PC Power Supplies
- Add WBAR Launch Dock to Raspberry Pi
- Add MPG123 Terminal Music Player to Raspberry Pi, Linux
- Basics of Alsamixer Audio Control for Linux
- Add Solid State Hard Drive to Raspberry Pi
- Beep a PC Speaker Add Beeper to Raspberry Pi
- Using FEH Wallpaper Setter Under Linux
- Scrot Lite Weight Screen Shot Software for Linux
- Using Light Weight Beaver Text Editor
- Install Viewnior Image Viewer for Linux
- Zmixer ALSA Sound Control Tutorial
- Tutorial Xinitrc Desktop Manager Control for Linux
- Setup Raspberry Pi Using JWM Window Manager
- Web Master
- Gen. Electronics Homepage
- YouTube Channel
- Current Control Circuits
- Design LM317 Constant Current Circuits
- Constant Current Circuits with the LM334
- Experiments with TL431A Shunt Regulator
- Transistor Circuits
- H-Bridge Motor Control with Power MOSFETs
- Insulated Gate Bipolar Transistor IGBT Circuits
- ULN2003A Darlington Transistor Array with Circuit Examples
- Power Supply Basics
- Basic Power Supply Rectification Tutorial
- Basic Triacs and SCR Projects and Circuits
- Transistor-Zener Diode Regulator Circuits
- Arduino Microcontroller
- Arduino Code Examples
- Rotary Encoder Using Arduino Hardware Interrupts
- Raspberry Pi Single Board Computer
- Raspberry Pi Openbox Linux System
- ADS1115 4-Channel ADC Uses I2C with Raspberry Pi
- +Microchip PIC Controllers
- Microchip PIC12F683 Programming Circuits Tutorial
- Microchip PIC16F628A Assembly
- 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
- Quick navigation of this website:
- Basic Electronics Learning and Projects
- Arduino Microcontroller Projects
- Raspberry Pi and Linux
- Connecting a PC Printer Port to Electronics with Python
- Microchip PIC 18F2550
- PICAXE Microcontroller
Web site Copyright Lewis Loflin, All rights reserved.
If using this material on another site, please provide a link back to my site.