Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active November 30, 2023 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save probonopd/bf6d4fc854ba62b8c25807528cfe7962 to your computer and use it in GitHub Desktop.
Save probonopd/bf6d4fc854ba62b8c25807528cfe7962 to your computer and use it in GitHub Desktop.

Raspberry Pi 5

Raspberry Pi OS Wayland based desktop

  • Performance is acceptable for a desktop on a Pi for the first time, including 1080p YouTube in Chromium
  • Uses Wayfire window manager with Wayland backend by default but can be switched to Xorg with Openbox
  • wfrespawn is used to restart processes like the panel and the desktop (pcmanfm)
  • Screen recording works with sudo apt install wf-recorder. https://github.com/ammen99/wf-recorder is like screen recording with ffmpeg and it really "just works"! sudo apt install wf-recorder -a also records audio.
  • Screen sharing with Webex does not work in Chromium, desplite Wayland and Pipewire being there
  • Hence, how can I switch from Wayland to a X11 session? --> Using the Raspberry Pi Software Configuration Tool (raspi-config) under "6 Advanced Options" --> System then uses Openbox after rebooting. Seems to then use /usr/share/xsessions/LXDE-pi-x.desktop which in turn runs /usr/bin/startlxde-pi which in turn runs exec /usr/bin/lxsession -s LXDE-pi -e LXDE
  • Panel seems to be custom made is called wf-panel-pi (runs under Wayland and Xorg); how can I get a global menu widget in there?
  • sudo apt install code # VSCode; works nicely with GitHub Copilot
  • Use zram with zstd by running https://raw.githubusercontent.com/Botspot/pi-apps/master/apps/More%20RAM/install

Making default configuration changes

  • Richt-click on the desktop -> Appearance Settings -> Defaults -> Set to "for small screens"
  • Move top panel to the bottom
  • Set system font to Nimbus Sans 10
  • Set theme to PiX

Enabling "Aero Snap"

~/.config/wayfire.ini or /etc/wayfire/defaults.ini

[grid]
...
mouse_snap = true

Upstream disabled it intentionally.

Swapping Ctl and Alt

~/.config/wayfire.ini or /etc/wayfire/defaults.ini

[input]
xkb_model=pc105
xkb_layout=de
xkb_variant=nodeadkeys
xkb_options=ctrl:swap_lalt_lctl

Installing Pi-Apps

  • Install Pi-Apps to easily install "More RAM" and fully functional WINE (including ability to run x86 and x86_64), among others
  • Their WINE install script is very lengthy, may to comment some things out (such as changing the resolution and installing mscorefonts etc.)
  • cd ~/pi-apps/apps/More\ RAM/ && sudo ./install

Installing Qt development environment

sudo apt-get install qt5-qmake qtbase5-dev-tools cmake qtcreator

Whenever I run a Qt application I see in the console: WARNING: v3d support for hw version 71 is neither a complete nor a conformant OpenGL implementation. Testing use only. What is v3d?

Making customized Raspberry Pi OS images

https://github.com/probonopd/custom-raspberry-pi-os

Installing KDE Plasma on the Raspberry Pi OS non-desktop variant

  • The non-desktop variant doesn't have the language autodetection etc.
  • It has a text interface that asks questions at the first start
  • sudo apt -y install kde-full chroium-browser to install KDE Plasma and web browser
  • startplasma-wayland to start KDE Plasma without needing an X server
  • Can make the system read-only using sudo rsapi-config -> Performance
  • Enable zsram using https://raw.githubusercontent.com/Botspot/pi-apps/master/apps/More%20RAM/install

Automatically log into the text console by creating the file /etc/systemd/system/getty@tty1.service.d/override.conf with the content

[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin user %I $TERM
Type=idle

At the end of ~/.profile, append

if [ $(tty) == /dev/tty1 ]; then
    startplasma-wayland
fi

...or somehow (how?) get sddm to work.

Enable splash by adding logo.nologo quiet loglevel=0 plymouth.enable=0 vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fastboot noatime nodiratime noram

Building helloDesktop

Start with Raspberry Pi OS, change it to use Xorg, then liberally follow the hints below to get something like the following:

image

Of course, all of this shoud still be packaged nicely.

launch

Works as intended

Menu

For whatever reason, libprocps cannot be installed using apt; Workaround:

wget http://ftp.de.debian.org/debian/pool/main/p/procps/libprocps-dev_3.3.17-5_arm64.deb
wget http://ftp.de.debian.org/debian/pool/main/p/procps/libprocps8_3.3.17-5_arm64.deb
sudo dpkg -i libprocps*.deb 

FIXME: Segfaults

Filer

For whatever reason, doesn't want to compile with g++, wants

sudo apt install clang-15
sudo ln -s /usr/lib/llvm-15/bin/clang++ /usr/bin/

Works. Shows transparent background on desktop items only after QT_QPA_PLATFORMTHEME=plasma is set.

QtPlugin

Need to symlink /usr/local/etc/... to /etc/... - should be fixed in CMake

BreezeEnhanced

Need sudo apt install libkdecorations2-dev libkf5guiaddons-dev libkf5configwidgets-dev libkf5i18n-dev, then builds and works ok

QKeySequenceOverride

Does not build, fatal error: 'QKeySequence' file not found. build.sh hardcodes BSDism /usr/local/, should be fixed.

Fonts and settings

See https://github.com/probonopd/buntu-iso-builder/blob/main/build/switch.sh

Logging out

Ctrl-Alt-Entf. Opens lxde-pi-shutdown-helper. Menu should be updated to make use of it?

sudo rm /System/Menu.app/Shutdown 
sudo ln -s $(which lxde-pi-shutdown-helper) /System/Menu.app/Shutdown

Session

In sudo nano /etc/xdg/lxsession/LXDE-pi/autostart comment out

#@lxpanel --profile LXDE-pi
#@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash

Environment variables

In /usr/bin/setup_env, append

export QT_QPA_PLATFORMTHEME=panda

Change to KWin

In /etc/xdg/lxsession/LXDE-pi/desktop.conf set

[Session]
#window_manager=openbox-lxde-pi
window_manager=kwin_x11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment