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:
- System Settings (sliders icon near bottom left)
- Hardware
- Input Devices
- Keyboard
- Hardware
- Keyboard model = Generic | Generic 104-key PC (or as applicable)
- NumLock on Plasma Startup = Turn on
- Layouts
- Configure layouts
- + Add
- Layout = English (US)
- Variant = English (Dvorak)
- Display and Monitor
- Compositor
- Make sure OpenGL is enabled (look for nasty message about it being disabled because of a crash)
Then the rest:
- Remove unwanted icons from desktop by right click, Move to Trash. (You can trash the Trash icon this way.)
- Right click the task bar
- Show Alternatives... and switch to Task Manager (from Icons-Only Task Manager) [Footnote 1]
- Configure Task Manager...
- Behavior
- Show only tasks
- From current screen = off
- From current desktop = off
- From current activity = off
- That are minimized = off
- Enter Edit Mode
- Panel height = 26
- Move the Pager (currently only appearing as an empty box in edit mode) from the right side to the left (just right of Application Launcher)
- Right click the clock in the task bar
- Configure Digital Clock...
- Appearance
- Information: Show date = on, Always beside time
- Show time zone = Always
- Display time zone as = Code
- Time display = 24-Hour
- Date format = Custom, ddd MMM d
- System Settings (sliders icon near bottom left)
- Appearance (Global Theme)
- Window Decorations
- Fonts
- Optional: Replace all Noto Sans with Public Sans for better readability at small sizes
- When global scale is set to 175%, Force font DPI here will get set to 168 (= 1.75 × 96) (4k displays only)
- Cursors
- Size = 48 (4k displays only)
- Workspace
- Workspace Behavior
- Desktop Effects
- Screen Edges
- Maximize: Windows dragged to top edge = off
- Switch desktop on edge = Always Enabled
- Screen Locking
- Lock screen automatically
- After idle time = off
- After waking from sleep = off
- Virtual Desktops
- Rows = 2
- + Add until there are 6 desktops
- Name them Desktop [1-6]
- Options
- Navigation wraps around = off
- Show animation when switching = off
- Show on-screen display when switching = off
- Window Management
- Window Behavior
- Focus
- Window activation policy = Focus follows mouse
- Titlebar Actions
- Maximize Button Actions
- Left click = Vertically maximize
- Middle click = Horizontally maximize
- Right click = Maximize
- Movement
- Window geometry: Display when moving or resizing = on
- Window Rules
- + Add New...
- Description = Window settings for log konsoles
- Window class (application) = Exact Match, konsole
- + Add Property...
- Window matching
- Window title, click the +
- Window title = Regular Expression, ((info)|(messages)).*Konsole [Footnote 2]
- + Add Property...
- Arrangement & Access
- Skip taskbar, click the +
- Skip taskbar = Force, Yes
- + Add New...
- Description = Emacs keys
- Window class (application) = Substring Match, emacs
- + Add Property...
- Appearance & Fixes
- Ignore global shortcuts, click the +
- Ignore global shortcuts = Force, Yes
- Shortcuts
- System Services
- KWin [Footnotes 3 & 4]
- Make Window Fullscreen = F12
- Close Window = Ctrl-F12
- Kill Window = Shift-Ctrl-F12
- Startup and Shutdown
- Autostart
- + Add...
- + Add Login Script...
- Add bash script to launch log windows [Footnote 5]
- Background Services
- Desktop Session
- When logging in = Start with an empty session
- Personalization
- Notifications
- Applications: Configure...
- System Services
- KWin Window Manager
- Configure Events...
- Graphics Reset
- Uncheck everything [Footnote 6]
- Applications
- File Associations
- This is a disaster. There are thousands of them, they're all WRONG, and there's no way to assign them by category (like audio, text, etc.).
- Default Applications
- Web browser = Firefox
- File manager = Dolphin [Footnote 7]
- Email client = KMail
- Terminal emulator = Konsole
- Hardware
- Display and Monitor
- Display Configuration
- Global scale = 175% (4k displays only)
- Launch Dolphin (File Manager, Manila folder icon)
- 3 lines menu in upper right
- Configure
- Configure Dolphin...
- Trash
- Delete files older than 1 day
- Launch Okular
- Settings
- Configure Keyboard Shortcuts...
- Beginning of the document, Alternate = Home
- End of the document, Alternate = End
- Launch Konsole
- Ctrl + Shift + m to show the menu bar
- Right click on the menu bar
- Main Toolbar = off
- Session Toolbar = off
- Settings
- Configure Notifications...
- Bell in Focused Session
- Run command = /usr/local/basics/bin/beep -f 1000
- Uncheck everything else
- Bell in Non-Focused Session
- Run command = /usr/local/basics/bin/beep -f 1000
- Uncheck everything else
- Configure Konsole...
- General
- Process and window
- Remember window size = off
- Profiles
- + New...
- General
- Name = Normal
- Default profile = on
- Initial terminal size = 80 x 24
- Terminal bell mode = Visual Bell
- Appearance
- Color scheme & font
- Click on Black on Light Yellow, then + New...
- Description = Normal Color Scheme
- Background = #D2B48C, #D2BFA7, #D2CBC2
- Font = Liberation Mono 12pt
- Scrolling
- Scrollback: Fixed size = 10000 lines
- Scrollbar position = Left side
- Click on Normal (default), then + New...
- General
- Advanced
- Default character encoding = Western European > ISO 8859-1
- Click on Normal (default), then + New...
- General
- Appearance
- Color scheme & font
- Font = Liberation Mono 7pt
- Click on Normal (default), then + New...
- General
- Name = Beeping
- Terminal bell mode = System Notifications
- Right click the task bar
- Right click the empty panel
- Enter Edit Mode
- Screen Edge, drag to right side
- Panel width = 26
- More Options...
- Visibility = Windows Can Cover
- + Add Widgets...
- Konsole Profiles (drag to side bar)
- For each additional command [Footnote 8]
- Right click desktop
- Create New
- Link to Application...
- General
- Application
- Name = name it
- Command = full command line
- Optional:
- Drag new icon onto the side bar
- Delete icon from desktop
- Right click the side panel
- Enter Edit Mode
- Drag the bottom edge arrow up to fit to contents
[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:
- Firefox
- Emacs
- Latin-1 Konsole (LANG=en_US konsole --profile Latin-1)
- UTF-8 Konsole
- Psensor
- BiBTeX documentation (okular /usr/local/share/doc/bibtex/btxdoc.dvi)
- KMail
- For each relevant news feed, mpv --profile=news 'ytdl://ytsearch1:some news livestream' &>> ~/unkodi.log
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.
- Configure audio devices.
- Disable background services that are not applicable on this particular
device, like WiFi, Bluetooth, or touchpad.
- 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.
- 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.
- 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
- Hover previews of tasks on the task bar work in X11 but not in Wayland
- ~/.config/session gets 1 new garbage file on every launch
- Logs are full of spam from dbus-daemon, pulseaudio, and polkitd
- Activities are useless, but KWin won't run without libKF5Activities.so
- KWin does not distinguish mash or directional swipe from plain old click for titlebar buttons, so FVWM* configurations are untranslatable
- None of the widgets was a satisfactory replacement for FvwmTaskBarSwallow xload, or for psensor
- Most window ops can be triggered by clicking somewhere, somehow on the
title bar of a window. Kill Window cannot, but is instead triggered with a
KWin shortcut.
- There's no Identify Window function that you can bind to a menu or
button, but a similar function is buried under the tiny icon in the left
corner of a window's title bar > More Actions > Configure Special
Window Settings... > Detect Window Properties. Select the window to get
info, then cancel out of everything.
- The Quicklaunch widget gave me problems in the sidebar. It does not let
you edit the shortcuts. It makes the icons smaller.
- KDE can launch an alarming number of processes and always leaves junk running after it exits, such as:
- /usr/lib64/libexec/startplasma-waylandsession
- /usr/bin/pulseaudio --start --log-target=syslog
- gpg-agent --homedir /home/user/.gnupg --use-standard-socket --daemon
- dirmngr --daemon --homedir /home/user/.gnupg
- /usr/bin/xprop -root -remove KDE_FULL_SESSION
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