KDE
KDE is a free software community, producing a wide range of applications including the popular Plasma desktop environment.
Gentoo support for the KDE project is excellent, with comprehensive packaging of KDE Frameworks, Plasma, and Applications, as well as a wide array of other miscellaneous KDE-based software.
Prerequisites
Profile
Read relevant documentation before performing any profile changes.
Choosing an appropriate profile, although not required, is recommended as it sets a number of global and package-specific USE flags to ease installation and ensure a smooth KDE experience.
In order to choose the most suitable profile, first list what's available:
root #
eselect profile list
... [21] default/linux/amd64/23.0 (stable) [22] default/linux/amd64/23.0/systemd (stable) [23] default/linux/amd64/23.0/desktop (stable) [24] default/linux/amd64/23.0/desktop/systemd (stable) [25] default/linux/amd64/23.0/desktop/gnome (stable) [26] default/linux/amd64/23.0/desktop/gnome/systemd (stable) [27] default/linux/amd64/23.0/desktop/plasma (stable) [28] default/linux/amd64/23.0/desktop/plasma/systemd (stable) ...
Then, select the right profile, substituting X
with the appropriate profile number:
root #
eselect profile set X
For Plasma desktop environment choose desktop/plasma
with OpenRC or desktop/plasma/systemd
with systemd. Note that other USE flag combinations than set by the profile may technically be possible (especially if selected applications are run instead of a full KDE Plasma desktop environment), but may be unsupported, untested, or lead to unexpected loss of functionality.
Combined hardened profiles
Users that run hardened profiles can also combine it with all the features of the plasma desktop profile. For steps on doing this please follow KDE/Hardened_KDE_Plasma_profile.
Services
Default choices of these services will be pulled in automatically - by the installation steps in the following chapters - depending on the profile selection made earlier, but still need to be set up properly before starting KDE Plasma for the first time. For deviating from the defaults, it is recommended to install them in advance of KDE Plasma or KDE Gear via emerge --oneshot so that Portage will take them into account. Follow the links for information how to set up these services.
Session tracker
Choose exactly one of:
- elogind: Standalone logind package, default for desktop/plasma profile, extracted from systemd project for use with OpenRC or other init systems.
- systemd: Uses the session tracker part of systemd. Users of systemd do not need to take any other initiative here.
Device manager
By default, systemd-utils is used on OpenRC systems, and systemd is used on systemd systems. Users who don't want to change providers should skip this step.
Choose exactly one of:
- udev: Enables support for udev Linux dynamic and persistent device naming.
- systemd: Uses the device manager part of systemd. Users of systemd do not need to take any other initiative here.
Miscellaneous
- D-Bus: Enables use of the D-Bus message bus system.
- PipeWire: PipeWire is used for sound as well as screensharing and window previews on Wayland.
- polkit: Enables the polkit framework for controlling privileges for system-wide services.
- udisks: Enables support for some storage related services.
X server
Read and follow the instructions in the X server article to setup the X environment.
Wayland
For Plasma 6, have a system with applicable VIDEO_CARDS
USE expand settings and kernel with DRMs (Direct Rendering Manager) enabled for Mesa. KWin, the window manager and Wayland compositor, uniquely falls back to low performance software Rendering if unsatisfied.
Plasma
Plasma 6 is the current generation of KDE's desktop environment, based on Qt 6 and KDE Frameworks 6.
Available versions
KDE | Gentoo | Ebuild repository | Status |
---|---|---|---|
KDE Plasma 6.1.5 | kde-plasma/plasma-meta-6.1.5 | gentoo | Stable for amd64 and arm64; testing for ppc64, riscv and x86 |
KDE Plasma 6.2.3 | kde-plasma/plasma-meta-6.2.3 | gentoo | Testing for amd64, arm64, ppc64, riscv and x86 |
KDE Plasma 6.2 stable branch | kde-plasma/plasma-meta-6.2.49.9999 | KDE | Live version |
KDE Plasma 6 master branch | kde-plasma/plasma-meta-9999 | KDE | Live version |
Before proceeding, make sure to choose a Plasma profile.
Installation
USE flags
The kde-plasma/plasma-meta package provides the full Plasma desktop, configurable by a wealth of USE flags:
USE flags for kde-plasma/plasma-meta Merge this to pull in all Plasma 6 packages
+browser-integration
|
Enable integration with Chrome/Firefox with browser extensions |
+crash-handler
|
Pull in kde-plasma/drkonqi for assisted upstream crash reports |
+display-manager
|
Pull in a graphical display manager |
+elogind
|
Enable session tracking via sys-auth/elogind |
+firewall
|
Pull in kde-plasma/plasma-firewall for system firewall administration |
+kwallet
|
Enable support for KWallet auto-unlocking via kde-plasma/kwallet-pam |
+networkmanager
|
Enable net-misc/networkmanager support |
+sddm
|
Pull in the x11-misc/sddm display manager and system settings module |
+smart
|
Pull in kde-plasma/plasma-disks for disk health monitoring |
+wallpapers
|
Install wallpapers for the Plasma Workspace |
+xwayland
|
Enable Wayland windows screensharing to XWayland applications via gui-apps/xwaylandvideobridge |
accessibility
|
Add support for accessibility (eg 'at-spi' library) |
bluetooth
|
Enable Bluetooth Support |
colord
|
Enable kde-plasma/kwin color management via x11-misc/colord |
crypt
|
Pull in kde-plasma/plasma-vault for encrypted vaults integration |
cups
|
Add support for CUPS (Common Unix Printing System) |
discover
|
Pull in resources management GUI; a centralised GHNS alternative and optional sys-apps/fwupd frontend |
flatpak
|
Pull in kde-plasma/flatpak-kcm for flatpak permissions administration |
grub
|
Pull in Breeze theme for sys-boot/grub |
gtk
|
Enable Breeze widget style and system settings module for GTK+ |
oxygen-theme
|
Pull in Oxygen icons, sound theme and visual style for KDE Plasma |
plymouth
|
Pull in Breeze theme for sys-boot/plymouth |
pulseaudio
|
Install Plasma applet for PulseAudio volume management |
qt5
|
Pull in required packages for seamless integration of KF5/Qt5-based applications |
rdp
|
Enables RDP/Remote Desktop support |
sdk
|
Pull in kde-plasma/plasma-sdk for Plasma development |
systemd
|
Enable use of systemd-specific libraries and features like socket activation or session tracking |
thunderbolt
|
Pull in kde-plasma/plasma-thunderbolt control center module |
unsupported
|
Allow packages that are known to ruin runtime experience ** DO NOT FILE BUGS WITH THIS ENABLED ** |
wacom
|
Pull in kde-plasma/wacomtablet control center module |
webengine
|
Use kde-apps/khelpcenter to access the locally installed KDE Help System Handbook |
Emerge
root #
emerge --ask kde-plasma/plasma-meta
Alternatively, kde-plasma/plasma-desktop provides a very basic desktop, leaving users free to install only the extra packages they require - or rather, figure out missing features on their own.
Please note that installing just kde-plasma/plasma-desktop will exclude important packages needed for KDE Plasma to function, such as kde-plasma/powerdevil (power management, suspend and hibernate options), kde-plasma/systemsettings, and many more. This package should be used with the understanding that additional packages will need to be installed to ensure a functioning environment. Do not expect support when using this package.
Starting Plasma
Display manager
SDDM (Simple Desktop Display Manager) is the recommended login manager and is pulled in automatically via kde-plasma/plasma-meta by default. This is the preferred option. Alternatively, LightDM can be used and pulled in by setting USE flag -sddm
for kde-plasma/plasma-meta. Change the setting accordingly in /etc/conf.d/display-manager. Also, be sure to read through the SDDM page if further issues appear.
No display manager
Plasma can be started the old-fashioned way with startx, but extra care needs to be taken to ensure it gets a valid session.
#!/bin/sh
exec dbus-launch --exit-with-session startplasma-x11
When using Wayland, Plasma can be launched with dbus-run-session startplasma-wayland.
This can be added to a user's profile file which will be executed when logging in:
#!/bin/sh
dbus-run-session startplasma-wayland
Widgets
Many useful widgets are in the kde-plasma/kdeplasma-addons package (already pulled in by kde-plasma/plasma-meta):
root #
emerge --ask kde-plasma/kdeplasma-addons
KWallet
Many users will be introduced to kde-frameworks/kwallet, Plasma's encrypted password storage, while adding a (wireless) network connection after login or adding E-Mail accounts in kde-apps/kmail.
For managing KWallets, importing and exporting passwords, there is kde-apps/kwalletmanager:
root #
emerge --ask kde-apps/kwalletmanager
KWallet auto-unlocking
kde-plasma/kwallet-pam provides a mechanism to avoid being subsequently asked for access to kwallet after login.
root #
emerge --ask kde-plasma/kwallet-pam
It requires the following setup:
- For KWallet security, use classic blowfish encryption instead of GPG
- Choose same password for login and kwallet
- Configure a display manager with support for PAM - both x11-misc/sddm and x11-misc/lightdm fulfill that requirement:
-auth optional pam_kwallet5.so
-session optional pam_kwallet5.so auto_start
For unlocking on tty login (no display manager, or like gui-apps/tuigreet), edit /etc/pam.d/login accordingly. The user will need to specify the force_run parameter.
-auth optional pam_kwallet5.so
-session optional pam_kwallet5.so auto_start force_run
For LightDM, /etc/pam.d/lightdm needs to be edited instead.
If the filesystem containing a user's KWallet files is mounted by pam_mount upon logging on, it may be required to copy ~/.local/share/kwalletd/kdewallet.salt to the same path on the root filesystem. Otherwise, PAM attempts to unlock KWallet before the home directory is available and fails. The file ~/.local/share/kwalletd/kdewallet.kwl which actually contains the encrypted KWallet passwords does not need to be copied.
Disabling KWallet
To disable the KWallet subsystem completely, edit the following file:
[Wallet]
Enabled=false
SSH/GPG Agent startup/shutdown scripts
ssh-agent scripts are located in /etc/xdg/plasma-workspace/env and /etc/xdg/plasma-workspace/shutdown. Shutdown scripts require executable bit set because they are not sourced. The Keychain article provides more information about this.
Non-root user authentication for dialogs
Some KDE dialogs such as printers, adding wireless networks and adding users require administrator authentication. This is handled through sys-auth/polkit and operates independently from app-admin/sudo. By default in Gentoo, the root account is the only administrator, and so even if a user account can run root commands through sudo, authentication in these KDE dialogs will fail.
Adding wireless networks using net-misc/networkmanager is allowed by a polkit rule which is part of the Gentoo package and already allows access for every user in the group plugdev. For other dialogs the behavior must be configured manually: If all users of the group wheel are required to be administrators, create a copy of /usr/share/polkit-1/rules.d/50-default.rules starting with a number lower than 50, and edit the line return ["unix-user:0"] to the following:
polkit.addAdminRule(function(action, subject) {
return ["unix-group:wheel"];
});
The Polkit wiki page provides more details on rules configuration.
Run GUI applications with root privileges
It could be a very bad idea to start GUI applications with root privileges, versus adding the regular user to the relevant group or simply just running the command unprivileged. Only use kdesu when absolutely necessary.
KDE Plasma has a utility to start graphical programs with root privileges. It is provided by kde-plasma/kdesu-gui and is already pulled in by kde-plasma/plasma-meta. It requires Xorg, and only works within X[1].
root #
emerge --ask kde-plasma/kdesu-gui
It can be used by invoking kdesu either from KRunner or a terminal emulator:
user $
kdesu <program-name>
A message dialog will be displayed prompting for the root password.
Some applications such as kwrite, dolphin etc. refuse to be opened with kdesu for security reasons.
By default, kdesu internally uses su, which may not be preferred for some use cases. It is possible to use sudo or other sudo-compatible commands, by changing kdesurc:
[super-user-command]
super-user-command=sudo
Files
XDG standard directories are being used for KDE Plasma and KDE applications:
- $XDG_CONFIG_HOME (defaults to $HOME/.config) - Configuration files
- $XDG_DATA_HOME (defaults to $HOME/.local/share) - Application data
Removal
The first step to remove KDE Plasma and its dependencies is to unmerge kde-plasma/plasma-meta. This will not yet remove any files from the installation, so the desktop environment will keep running:
root #
emerge --ask --depclean --verbose kde-plasma/plasma-meta
In a next step it can be useful to scan /etc/portage directory for any KDE Plasma specific entries in package.mask, package.unmask and package.accept_keywords and clean them up.
Finally, run the command to uninstall any Plasma packages and their dependencies. It would make sense to quit any running Plasma session beforehand:
root #
emerge --ask --depclean
Please note that this will not just remove KDE Plasma but also any other package not registered (or being depended on) in @world. Carefully read through the list of packages to be removed before continuing. Alternatively, run this command prior to unmerging of kde-plasma/plasma-meta to get an overview of already dangling packages on the system.
Applications
KDE Gear consists of various applications and supporting libraries based on Qt/KDE Frameworks.
Available versions
KDE | Gentoo | Ebuild repository | Status |
---|---|---|---|
KDE Gear 24.08.1 | kde-apps/kde-apps-meta-24.08.1 | gentoo | Stable for amd64 and arm64; testing for x86 |
KDE Gear 24.08.3 | kde-apps/kde-apps-meta-24.08.3 | gentoo | Testing for amd64, arm64 and x86 |
KDE Gear 24.12 stable branch | kde-apps/kde-apps-meta-24.12.49.9999 | KDE | Live version |
KDE Gear master branch | kde-apps/kde-apps-meta-9999 | KDE | Live version |
KDE Gear is divided in the following meta packages:
Package name | Description |
---|---|
kde-apps/kdeaccessibility-meta | Accessibility applications and utilities. |
kde-apps/kdeadmin-meta | Administrative utilities, which help in managing the system. |
kde-apps/kdecore-meta | Basic applications such as file browser, editor, terminal emulator. |
kde-apps/kdeedu-meta | Educational applications and games. |
kde-apps/kdegames-meta | Standard desktop games. |
kde-apps/kdegraphics-meta | Graphics applications such as image viewers, color pickers, etc. |
kde-apps/kdemultimedia-meta | Audio and video playback applications and services. |
kde-apps/kdenetwork-meta | Network applications and VNC services. |
kde-apps/kdepim-meta | PIM applications such as emailer, addressbook, organizer, etc. |
kde-apps/kdesdk-meta | Various development tools. |
kde-apps/kdeutils-meta | Standard desktop utilities such as an archiver, a calculator, etc. |
Installation
The kde-apps/kde-apps-meta package provides the full KDE Gear bundle:
root #
emerge --ask kde-apps/kde-apps-meta
If not all the packages are required, one or several smaller meta packages from the list above may be picked instead. Alternatively, it is possible to set USE flags to reduce the number of applications installed by kde-apps/kde-apps-meta.
Localization
Plasma and Applications are shipping their localization per-package. Enable desired localization in System Settings.
KDE PIM
KDE PIM is a whole suite of applications to manage personal information including mail, calendar, contacts and more. It has several optional runtime dependencies to extend its functionality:
- Virus detection: app-antivirus/clamav
- Spam filtering: mail-filter/bogofilter or mail-filter/spamassassin
Frameworks
KDE Frameworks is a collection of libraries and software frameworks that provide the foundation for KDE Plasma and KDE Gear (applications), but may be leveraged by any Qt application.
As Frameworks are mostly libraries and provide little user functionality, it's not necessary to install them manually - the required packages will be pulled in automatically as dependencies.
Available versions
KDE | Gentoo | Ebuild repository | Status |
---|---|---|---|
KDE Frameworks 5.116.0 | kde-frameworks/*-5.116.0 | gentoo | Stable for amd64, arm64, and x86; testing for arm, loong, ppc64 and riscv |
KDE Frameworks 6.6.0 | kde-frameworks/*-6.6.0 | gentoo | Stable for amd64 and arm64 and ppc64; testing for riscv and x86 |
KDE Frameworks 6.7.0 | kde-frameworks/*-6.7.0 | gentoo | Stable for amd64; testing for arm64, ppc64, riscv and x86 |
KDE Frameworks 6.8.0 | kde-frameworks/*-6.8.0 | gentoo | Testing for amd64, arm64, ppc64, riscv and x86 |
KDE Frameworks 6 (master) branch | kde-frameworks/*-9999 | KDE | Live version |
More KDE software
The most important KDE applications are in the Gentoo ebuild repository and many are located in the kde-apps and kde-misc categories.
Troubleshooting
Refer to the Troubleshooting sub-article.
See also
- KDE/Ebuild repository — provides instructions on adding Gentoo's KDE ebuild development repository to a system.
- kde-sunset ebuild repository - For old KDE software that has been removed from the main ebuild repository.
- Desktop environment — provides a list of desktop environments available in Gentoo.