Installing RaspberryPi Desktop
1. Introduction
Raspberry Pi Desktop is actually a Raspberry Pi OS installed on a PC. It is based on Debian, it looks nice, and it is lightweight. It can give a new life to an old computer that is no longer powerful enough to run a modern commercial operating system. Actually, RaspiOS is so nice, that I would prefer it over other alternatives even on a new or powerful computer.
The only problem is that it is a bit outdated. For the time being, only the 32-bit version is available, that was released over two years ago, and is based on Debian 11 (bullseye). However, the good news is that it is not too difficult to install RaspiOS on top of the latest Debian stable realese (which is Debian 12, or bookworm). In this article I am going to show how I did it.
2. Install Debian 12 LXDE
We will start by installing Debian 12 with LXDE (the desktop of RaspiOS is based on LXDE).
-
Download debian-live-12.8.0-amd64-lxde.iso from ISO images:
wget https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.8.0-amd64-lxde.iso
-
Write it to an USB flash drive:
lsblk sudo cp debian-live-12.8.0-amd64-lxde.iso /dev/sdX sync
-
Boot the live Debian system from the flash drive.
Then start the installation from the icon "Install Debian":Figure 1. Start installing DebianAt the end, reboot and remove the flash drive.
3. Install RaspiOS
On top of Debian we can install the RaspberryPi packages.
-
Let’s make sure that we have the right package sources:
# debian package sources
cat <<EOF
>/etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmwareEOF
# raspberry package sourcescat <<EOF
>/etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ bookworm mainEOF
-
Get the key of the raspberrypi packages (
82B129927FA3303E
):# get the key of the raspberry source apt install --yes gpg apt-key adv \ --keyserver hkps://keyserver.ubuntu.com \ --recv-keys 82B129927FA3303E cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/
Another way
-
Update and upgrade:
apt update apt upgrade --yes
-
Install package
raspberrypi-ui-mods
(RaspiOS modifications of the LXDE desktop):apt install --yes raspberrypi-ui-mods
-
Install additional packages:
Install packages
-
Optionally, install some other packages that might be useful:
Install packages
The result may look something like this:
4. Customizing
4.1. Disable the switch-to-labwc prompt
Usually RaspiOS displays a popup window that asks wheather to keep X11 or to switch to Wayland/labwc. Let’s disable this prompt and keep X11 for the time being:
rm -f /etc/xdg/autostart/labwc-prompt.desktop
If later we want to switch to Wayland, we can do it from the command line with:
sudo raspi-config
4.2. Use multiple desktops / workspaces
By default RaspiOS has a single desktop. We can increase the number of
desktops using the tool obconf
(openbox configurator).
apt install --yes obconf
obconf
Alternatively, edit the configuration file
~/.config/openbox/lxde-pi-rc.xml
and make sure that it
contains a section like this:
<desktops>
<number>3</number>
<firstdesk>1</firstdesk>
<names>
<name>Desk1</name>
<name>Desk2</name>
<name>Desk3</name>
</names>
<popupTime>0</popupTime>
</desktops>
Then run:
openbox --reconfigure
Remove the file ~/.config/openbox/lxde-rc.xml , if
there is such a file.
|
In order to show what is the current desktop, add the applet "Desktop Number / Workspace Name":
-
Right-click on the panel and select "Add / Remove Panel Items".
-
Click on "Add" and select "Desktop Number / Workspace Name", then "Add" button at the bottom.
The plugin "Desktop Pager" could have been useful too, but unfortunately it breaks the style/layout of the panel, when added. |
4.3. Set up Hotkeys to switch between multiple desktops
Because multiple desktops are disabled by default, RaspiOS Desktop does not define hotkeys for switching between multiple desktops. This is easy to fix:
-
Edit the configuration file
~/.config/openbox/lxde-pi-rc.xml
and make sure that it contains definitions like this:<keyboard> ... <keybind key="C-S-Left"> <action name="DesktopLeft"> <dialog>no</dialog> <wrap>yes</wrap> </action> </keybind> <keybind key="C-S-Right"> <action name="DesktopRight"> <dialog>no</dialog> <wrap>yes</wrap> </action> </keybind> ... </keyboard>
-
Reconfigure openbox:
openbox --reconfigure
The hotkeys that we have chosen are Ctrl-Shift-Left and Ctrl-Shift-Right (Ctrl-Alt-Left and Ctrl-Alt-Right are already defined for other things).
For more details see this page.
4.4. Install font Monaco
I like this font and sometimes I use it as the default font for the terminal. It can be installed like this:
mkdir -p /usr/share/fonts/truetype/Monaco
cd /usr/share/fonts/truetype/Monaco
wget https://github.com/mikesmullin/gvim/raw/master/.fonts/Monaco_Linux.ttf
fc-cache -f .