Configuration notes and bloatometry of KDE Plasma 5

Last modified: 2024-09-05 08:47

Following is my record of important changes to the default configuration given in Slackware 15.0 in case it becomes necessary to repeat them.  Unfortunately, as I've already discovered, System Settings menus get rearranged between versions so that you can't find anything without searching.

The minimum amount of RAM to be thinking about running KDE on a 32-bit PC is 1 GiB.  I got it "technically running" with 512 MiB of RAM, but it's deep into swap and not viable for serious use.  See bloatometry.

Configuration of KDE is scattered across hundreds, if not thousands, of hidden files that accumulate under your home directory.  There is no way to export a KDE configuration except to bulk copy these files and hope for the best.  Ideally, configuration would all be in ~/.config (XDG_CONFIG_HOME), but some important things, like Konsole profiles, are stored in ~/.local/share (XDG_DATA_HOME).  If copying those files still isn't enough, the missing pieces could be in ~/.local/state (XDG_STATE_HOME), ~/.cache (XDG_CACHE_HOME), or ~/.kde.

The important files are comingled with all kinds of unrelated flotsam and jetsam from which they are not easily distinguished or separated.  Nothing that uses these directories cleans up after itself.  XDG_*_HOME is a reinvention of the square wheel known as Windows Registry:  an unregulated garbage dump that is dangerous to clean and that only gets bigger and worse over time until it catches fire and you have to start again.

Some of the config files get hardcoded paths to your home directory and have to be patched if they are copied to another account.

Before launching KDE:

In KDE, do this first because QWERTY is a pain:

Then the rest:

[Footnote 1] Task Manager emulates the old Windows task bar with a bar for each window and title text inside.  Icons-Only Task Manager is the new style with just icons.

[Footnote 2] It may be uncool to admit that you don't speak regex like a native, but I thought this should have worked with fewer parentheses.  It did not.  Good luck finding documentation.

[Footnote 3] It seems that you have to Apply and then use the caret ^ to roll up the key selection dialog or the setting won't stick.  Make sure it takes effect and try again if it did not.

[Footnote 4] Confirm the taking of key combinations from previous assignments as applicable.  Ctrl-Alt-F12 is reserved for virtual console switching and cannot be taken.

[Footnote 5] This is logterms.sh:

#!/bin/bash
# ROOTHEIGHT is set by xinitrc
if [ $ROOTHEIGHT -gt 2000 ]; then
  # 3840×2160 with 175% global display scaling.  105 × 1.75 ≈ 184
  YPLUS=105
else
  YPLUS=111
fi
konsole --profile 'Small font' --hide-menubar --hide-tabbar -p terminalrows=7 --qwindowgeometry +0+0      -p tabtitle=info     -e tail -f /var/log/info &
konsole --profile 'Small font' --hide-menubar --hide-tabbar -p terminalrows=7 --qwindowgeometry +0+$YPLUS -p tabtitle=messages -e tail -f /var/log/messages &

It is possible to get one konsole with two panes, but it was more trouble than it was worth.

[Footnote 6] I get these every time I resume from sleep mode.

[Footnote 7] Dolphin is KDE's simple default file manager.  Krusader is an alternative "Commander-like" file manager with more functions and less pretty.  Konqueror is the KDE web browser, also usable as a file manager.  Thunar is the Xfce file manager.

[Footnote 8] Additional commands include:

In the case of apps whose default launchers are already present and satisfactory (Emacs, KMail, default Konsole), you can just drag the icon from the "start menu" in the lower left corner all the way to the side panel.

Post-deployment

Certain things have to be set individually after the template is copied in.

  1. Configure audio devices.
  2. Disable background services that are not applicable on this particular device, like WiFi, Bluetooth, or touchpad.
  3. For accounts where secrets are likely to end up on the clipboard, configure Klipper settings, uncheck "Save clipboard contents on exit" and maybe reduce the clipboard history size.  Also delete .local/share/klipper/history2.lst.
  4. Don't bother changing System Settings > Hardware > Display and Monitor > Compositor > Rendering backend from the default of OpenGL 2.0 to OpenGL 3.1; it only makes things worse.
  5. Fix System Settings > Personalization > Applications > File Associations until the cows come home.

Desktop crashes after suspend/resume (Nvidia)

Nvidia power management

First, the following module option needs to go in /etc/modprobe.d/nvidia.conf:

options nvidia NVreg_PreserveVideoMemoryAllocations=1

Second, there is extra stuff that needs doing in the suspend/resume process:

/usr/bin/nvidia-sleep.sh suspend
echo mem > /sys/power/state
/usr/bin/nvidia-sleep.sh resume

Nvidia's README linked above provides the systemd way to do it.  Also, elogind has a HandleNvidiaSleep option that is supposed to do what nvidia-sleep.sh does, but when I enabled it it somehow broke suspend.

Unsolved problems

There seems to be no support for the PC speaker.  "System Bell" in Konsole is routed to PulseAudio.  I worked around with a custom command.  Xterms using XWayland cannot beep at all; XWayland might not implement it.

The system of "Links to Applications" is obscure and error-prone.  It's never clear whether you are creating a new one, cloning an existing one, or destructively changing an existing one such that every other instance will change irretrievably.

The rule to ignore global shortcuts for Emacs does not work reliably.  An F12 keypress in a newly opened Emacs window sometimes triggers the global shortcut, sometimes makes it to Emacs, but usually goes into a black hole.  A left click on the desktop background followed by a left click on the Emacs window title bar decoration seems to fix it.

There are bugs related to desktop paging, such as when switching to the next desktop by mousing off the edge of the screen, it sometimes leaves the mouse on the same edge instead of warping it to the opposite side.  It looks like an interaction with the side panel (Task Manager).

Despite the configuration to delete files more than 1 day old, the trash does not automatically purge anything and must be emptied manually.

Regarding Appearance > Fonts, everything uses General, and nothing uses the Small, Toolbar, Menu, or Window title font settings.  Most annoyingly, KMail uses General for both the message list summaries and the compose window.  I can't get the text in the compose window to be larger without fouling up the text sizes everywhere else.

Additional notes

Bloatometry

The following measurement is from a 32-bit PC with 512 MiB of RAM after I had disabled every extraneous KDE thing that I could find.  The MiB column shows the sum of PSS and SwapPSS from /proc/*/smaps, which should be a reasonable estimate of the total resident and swapped memory attributable to a process.  The Swap column shows the ratio SwapPSS/(PSS+SwapPSS), which is the proportion of that memory that is currently swapped out.  Processes smaller than 10 MiB are not listed.  My Ruby script barely made the cutoff.

  PID   MiB Swap Command
 1274    99   7% /usr/bin/plasmashell 
 1461    38   0% /usr/bin/konsole 
 1228    37  27% /usr/bin/kwin_x11 
 1339    27   1% /usr/bin/pulseaudio --start --log-target=syslog 
 1170    26  61% /usr/bin/X :0 -nolisten tcp -logverbose 6 vt1 -keeptty -auth /h
 1328    21  26% konsole --profile Small font --hide-menubar --hide-tabbar -p te
 1327    20  28% konsole --profile Small font --hide-menubar --hide-tabbar -p te
 1224    20  68% /usr/bin/kded5 
 1321    19  30% /usr/bin/kmix --keepvisibility 
 1245    16  77% /usr/bin/kglobalaccel5 
 1244    15  80% /usr/bin/ksmserver 
 1278    15  78% /usr/lib/libexec/org_kde_powerdevil 
 1282    15  88% /usr/bin/kaccess 
 1211    15  83% /usr/lib/libexec/kf5/klauncher --fd=9 
 1318    15  36% /usr/lib/libexec/kactivitymanagerd 
 1210    14  94% kdeinit5: Running...           
 1297    13  87% /usr/bin/gmenudbusmenuproxy 
 1284    13  87% /usr/bin/xembedsniproxy 
 1397    13   0% /usr/lib/libexec/kf5/kscreen_backend_launcher 
 1187    13  88% startplasma-x11 
 1592    10   0% /usr/bin/ruby ./bloat.rb 

KB
Home