#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-491

### Chapter 32. KDE Plasma

- Prev

  kquickimageeditor-0.6.0

- Next

  GNOME

- Up
- Home

# Building Plasma

KDE Plasma is a collection of packages based on top of KDE Frameworks and QML. They implement the KDE Display Environment (Plasma).

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

The instructions below build all of the Plasma packages in one step by using a bash script.

### Package Information

- Download (HTTP): https://download.kde.org/stable/plasma/6.6.1

- Download MD5 sum: See Below

- Download size: 304 MB

- Estimated disk space required: 2.9 GB (690 MB installed)

- Estimated build time: 18 SBU (using parallelism=8)

### Plasma Dependencies

#### Required

Boost-1.90.0, FFmpeg-8.1, GTK-3.24.52, KDE Frameworks-6.23.0, kirigami-addons-1.10.0, kquickimageeditor-0.6.0, libdisplay-info-0.3.0, libpwquality-1.4.5, libqalculate-5.10.0, libnl-3.12.0, libxcvt-0.1.3, libxkbcommon-1.13.1, Mesa-26.0.1 built with Wayland-1.24.0, opencv-4.13.0, phonon-4.12.0, pipewire-1.6.4, pulseaudio-qt-1.8.1, qca-2.3.10, qcoro-0.13.0, qtkeychain-0.15.0, sassc-3.6.2, taglib-2.2.1, xdotool-4.20260303.1, and Xorg Evdev Driver-2.11.0

#### Recommended

gsettings-desktop-schemas-50.1, libcanberra-0.30, libinput-1.31.1, libpcap-1.10.6, libwacom-2.18.0 and Xorg Wacom Driver-1.2.4 (for wacomtablet), Linux-PAM-1.7.2, lm-sensors-3-6-2, oxygen-icons-6.1.0, pciutils-3.15.0, power-profiles-daemon-0.30, and the following Python modules: psutil-7.2.2, pygdbmi-0.11.0.0, sentry-sdk-2.53.0, urllib3-2.6.3 (if they are not installed, they will be downloaded and installed by the drkonqi build procedure)

#### Recommended (runtime)

AccountsService-23.13.9, breeze-icons-6.23.0, kio-extras-25.12.2, smartmontools-7.5, xdg-desktop-portal-1.20.4, and Xwayland-24.1.11

#### Optional

AppStream-1.1.2 (build with -qt=true), GLU-9.0.3, ibus-1.5.34, qtwebengine-6.11.0, KDevPlatform, libgps, libhybris, packagekit-qt, Qapt, SCIM, and socat (for pam_kwallet)

## Downloading KDE Plasma

The easiest way to get the KDE Plasma packages is to use a single wget to fetch them all at once:

    url=https://download.kde.org/stable/plasma/6.6.1/
    wget -r -nH -nd -A '*.xz' -np $url

    The options used here are:
      -r            recurse through child directories
      -nH           disable generation of host-prefixed directories
      -nd           do not create a hierarchy of directories
      -A '*.xz'     just get the *.xz files
      -np           don't get parent directories

## Setting Package Order

The order of building files is important due to internal dependencies. Create the list of files in the proper order as follows:

    cat > plasma-6.6.1.md5 << "EOF"
    4f409dfbea58c0194bb71342d0ce8f4b  kdecoration-6.6.1.tar.xz
    161fb91c028b345ca3cbf2757373b3ab  libkscreen-6.6.1.tar.xz
    9c7a297514843a3ddddc13aa47abb5d7  libksysguard-6.6.1.tar.xz
    8879fbb3390fefba522a604250b03f3f  breeze-6.6.1.tar.xz
    2205ac176646e3ee76f1de2424f6a4ba  breeze-gtk-6.6.1.tar.xz
    a1932a163232ba4b04c54edfc69579b7  layer-shell-qt-6.6.1.tar.xz
    14342002478d534479956cbc949254b6  plasma-activities-6.6.1.tar.xz
    c812ac7dd42ec942ce06a4659d5ac69d  libplasma-6.6.1.tar.xz
    9087540a32c4b25658ac59e33244d8ea  kscreenlocker-6.6.1.tar.xz
    c1e8c561eba6f967f11ce503dafc9787  kglobalacceld-6.6.1.tar.xz
    3528e0b917c4891486b12e6ed1030168  kwayland-6.6.1.tar.xz
    ec2badf4cd874cd18ac765a755836338  aurorae-6.6.1.tar.xz
    7677ee4d5784931db8c45fd3b48b166f  knighttime-6.6.1.tar.xz
    628e60b77b3eab550875de3949aa35f7  plasma-keyboard-6.6.1.tar.xz
    291c3b2f46bf450b29efaa802886b86b  kwin-x11-6.6.1.tar.xz
    39f4e1ae9dc6a6937c3b3e7072850972  kwin-6.6.1.tar.xz
    4a0f39978938484a679e8a882ea10dbd  plasma5support-6.6.1.tar.xz
    c1f8d27b30fd7d3a2ad5c06629e2dfa9  plasma-activities-stats-6.6.1.tar.xz
    6215a4047975f1aa07f6e31e67f7f2ce  kpipewire-6.6.1.tar.xz
    b01b7ab2c6c73bc734e1baf0ac05a1fc  plasma-workspace-6.6.1.tar.xz
    99a0f1570f2eb1a556567919aafde24d  plasma-disks-6.6.1.tar.xz
    1308b1f70a0c2e576e00bedc149cfc5e  bluedevil-6.6.1.tar.xz
    120d5212507410e9e640b2cb4e05b237  kde-gtk-config-6.6.1.tar.xz
    5898ecb85449eea4877ca0da8708c57e  kmenuedit-6.6.1.tar.xz
    0678fab975f29869dec87ea4a3b5e380  kscreen-6.6.1.tar.xz
    2eff25a4f86b5846f45e067dd38de72b  kwallet-pam-6.6.1.tar.xz
    3ee17a85d7c6075319da15a9f96a097f  kwrited-6.6.1.tar.xz
    92a560fcff81cdf41dd1e002687631bb  milou-6.6.1.tar.xz
    b735f04dab4fad80716624dcdf19af63  plasma-nm-6.6.1.tar.xz
    c8d4056e3ecff197fd8ce32b7ac3cd33  plasma-pa-6.6.1.tar.xz
    16951fa7b52c45599907e28ec39f6c54  plasma-workspace-wallpapers-6.6.1.tar.xz
    744e07404850d49d81c1e9b7c24c3cd2  polkit-kde-agent-1-6.6.1.tar.xz
    d1a5fc36ebf96509b1b7cbafc6c50db7  powerdevil-6.6.1.tar.xz
    4a28478ef792b30c1be1122043334e2e  plasma-desktop-6.6.1.tar.xz
    83fc20fc249fafaaff2726e05386f6c0  kgamma-6.6.1.tar.xz
    d6df6a2d508082658bbef39f978a0057  ksshaskpass-6.6.1.tar.xz
    #6c1b423684c274fe8aa241f744947726  plasma-sdk-6.6.1.tar.xz
    2097fac4cc8921235bda91a799c14072  sddm-kcm-6.6.1.tar.xz
    #6a838f81134545b07981cd415abf2b43  discover-6.6.1.tar.xz
    #3270523c12fc01464f77b2aaabf40df0  breeze-grub-6.6.1.tar.xz
    #706690c7a82f4d19b82541545a6e6955  breeze-plymouth-6.6.1.tar.xz
    03721c95d72680c04eac7a19fa18c61f  kactivitymanagerd-6.6.1.tar.xz
    6e243b4916f19bf21d28179f203fb815  plasma-integration-6.6.1.tar.xz
    #45fe33b0cdef10308f87bab81a579f23  plymouth-kcm-6.6.1.tar.xz
    27f300c60a131df57e6b9197c124de9e  xdg-desktop-portal-kde-6.6.1.tar.xz
    3e33d3646b14a7183d46f2437ac381ca  drkonqi-6.6.1.tar.xz
    865cc1c13294a010acb3dea4989b6f97  plasma-vault-6.6.1.tar.xz
    #33eb76e30f3b2b8524af88197252d2b0  plasma-browser-integration-6.6.1.tar.xz
    9a693af35e8c8344a2c16460dcb56f84  kde-cli-tools-6.6.1.tar.xz
    50a59eb8f544c1d60e0327aee273a62b  systemsettings-6.6.1.tar.xz
    #33bc395b7c8a9763046156069764f640  plasma-mobile-6.6.1.tar.xz
    #ec77afad227127067e0c0f52dca2e212  plasma-nano-6.6.1.tar.xz
    cc609934f45af383cc97477b677c5681  plasma-firewall-6.6.1.tar.xz
    906d76eee16fcafd6b01c139f9413167  plasma-systemmonitor-6.6.1.tar.xz
    9b9269172e245bba8d3c177ac9f47da9  qqc2-breeze-style-6.6.1.tar.xz
    32a2d492b1d2b8f8eadd7f1da56e9fc5  ksystemstats-6.6.1.tar.xz
    90909df56c06abb57ea3ff86b0ea704a  oxygen-sounds-6.6.1.tar.xz
    f0d88d636c596e7f5c00dbf22f6d0d74  kdeplasma-addons-6.6.1.tar.xz
    #7336030eef5bd5e8f05190590083f78b  flatpak-kcm-6.6.1.tar.xz
    94c59f878c783f9a9423d6c07e5b523e  plasma-welcome-6.6.1.tar.xz
    b4f2ab10ef951cbdd272b231e6aa54ab  ocean-sound-theme-6.6.1.tar.xz
    ec71ea05a3e2a47207e356df869621b0  print-manager-6.6.1.tar.xz
    a6c3248da1dae904438e3adf88a4abec  wacomtablet-6.6.1.tar.xz
    #5a25a38d722beaa030a6418a746a9939  kwayland-integration-6.6.1.tar.xz
    #1006dcf255da969bb6d09899a67d6c74  krdp-6.6.1.tar.xz
    33349b83b2a2415704544ea2300dbee1  oxygen-6.6.1.tar.xz
    #0eb4c0b91699d639960d4d2270335522  plasma-dialer-6.6.1.tar.xz
    #7a647c072b8b53fae615d3e66380d27b  spacebar-6.6.1.tar.xz
    11a7dcf6aec63d51bfba2e40ec669ac6  spectacle-6.6.1.tar.xz
    #1c707b638d35a7f4c76536dfc6cc3d1a  plasma-login-manager-6.6.1.tar.xz
    859c41b0e80c7b30e91f5f37f9060b0e  plasma-setup-6.6.1.tar.xz
    EOF

### About Commented Out Packages

In the above list, several files are commented out with a hash (#) character.

- The plasma-sdk package is optional and used for software development.

- The discover package requires AppStream-1.1.2 to be built with the -D qt=true switch.

- The breeze-grub, breeze-plymouth, and plymouth-kcm packages above are all for customized support of Plymouth which is designed to be run within an initial ram disk during boot (see the section called “About initramfs”).

- The plasma-browser-integration package is designed to implement browser integration for Plasma into Mozilla Firefox and Google Chrome. The package does build, but is only useful if you want these browsers to be integrated into the shell in a way that lets you see (and control) downloads from Plasma's notifications area, as well as allowing you to search browser history in the KDE Runner. Note that you must also install a browser extension for this to work. For more details, see the KDE Plasma wiki page about browser integration.

- The krdp package is used to allow an RDP server to be run while using Plasma. This feature requires the 2.x version of FreeRDP, which is not in BLFS.

- The plasma-nano package is used for embedded systems.

- The plasma-mobile, plasma-dialer, and spacebar packages provide phone functionality for Plasma.

- The flatpak-kcm package is for managing support of flatpak applications.

- The kwayland-integration application requires plasma5 support.

- The plasma-login-manager application provides a display manager for KDE Plasma, forked from SDDM and with an new frontend providing a greeter, wallpaper plugin integration and System Settings module (KCM).

## Installation of Plasma

### Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

1. Run the entire script as the root user (not recommended).

2. Use the sudo command from the Sudo-1.9.17p2 package.

3. Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

    as_root()
    {
      if   [ $EUID = 0 ];        then $*
      elif [ -x /usr/bin/sudo ]; then sudo $*
      else                            su -c \\"$*\\"
      fi
    }

    export -f as_root

First, start a subshell that will exit on error:

    bash -e

Install all of the packages by running the following commands:

    while read -r line; do

        # Get the file name, ignoring comments and blank lines
        if $(echo $line | grep -E -q '^ *$|^#' ); then continue; fi
        file=$(echo $line | cut -d" " -f2)

        pkg=$(       echo $file|sed 's|^.*/||')    # Remove directory
        name=$(      echo $pkg |sed 's|-6.*$||')   # Isolate package name
        packagedir=$(echo $pkg |sed 's|\.tar.*||') # Source directory

        tar -xf $file
        pushd $packagedir

           mkdir build
           cd    build

           cmake -D CMAKE_INSTALL_PREFIX=$KF6_PREFIX \
                 -D CMAKE_INSTALL_LIBEXECDIR=libexec \
                 -D CMAKE_BUILD_TYPE=Release         \
                 -D BUILD_QT5=OFF                    \
                 -D BUILD_TESTING=OFF                \
                 -W no-dev ..  &&

            make
            as_root make install
        popd

        as_root rm -rf $packagedir
        as_root /sbin/ldconfig

    done < plasma-6.6.1.md5

    exit

If you did not set `$KF6_PREFIX` to `/usr`, create symlinks to allow display managers to find Plasma, and to allow the XDG Desktop Portal to be detected. As the `root` user:

    # Setup xsessions (X11 sessions)
    install -dvm 755 /usr/share/xsessions
    cd /usr/share/xsessions

    [ -e plasma.desktop ] ||
    ln -sfv $KF6_PREFIX/share/xsessions/plasmax11.desktop

    # Setup wayland-sessions
    install -dvm 755 /usr/share/wayland-sessions
    cd /usr/share/wayland-sessions

    [ -e plasmawayland.desktop ] ||
    ln -sfv $KF6_PREFIX/share/wayland-sessions/plasma.desktop

    # Setup xdg-desktop-portal
    install -dvm 755 /usr/share/xdg-desktop-portal
    cd /usr/share/xdg-desktop-portal

    [ -e kde-portals.conf ] ||
    ln -sfv $KF6_PREFIX/share/xdg-desktop-portal/kde-portals.conf

    # Setup kde portal
    install -dvm 755 /usr/share/xdg-desktop-portal/portals
    cd /usr/share/xdg-desktop-portal/portals

    [ -e kde.portal ] ||
    ln -sfv $KF6_PREFIX/share/xdg-desktop-portal/portals/kde.portal

## Configuring Plasma

### Linux PAM Configuration

If you built Plasma with the recommended Linux PAM support, create necessary configuration files by running the following commands as the `root` user:

    cat > /etc/pam.d/kde << "EOF"
    # Begin /etc/pam.d/kde

    auth     requisite      pam_nologin.so
    auth     required       pam_env.so

    auth     required       pam_succeed_if.so uid >= 1000 quiet
    auth     include        system-auth

    account  include        system-account
    password include        system-password
    session  include        system-session

    # End /etc/pam.d/kde
    EOF

    cat > /etc/pam.d/kde-np << "EOF"
    # Begin /etc/pam.d/kde-np

    auth     requisite      pam_nologin.so
    auth     required       pam_env.so

    auth     required       pam_succeed_if.so uid >= 1000 quiet
    auth     required       pam_permit.so

    account  include        system-account
    password include        system-password
    session  include        system-session

    # End /etc/pam.d/kde-np
    EOF

    cat > /etc/pam.d/kscreensaver << "EOF"
    # Begin /etc/pam.d/kscreensaver

    auth    include system-auth
    account include system-account

    # End /etc/pam.d/kscreensaver
    EOF

## Starting Plasma

You can start Plasma from a TTY, using xinit-1.4.4.

To start Plasma using xinit-1.4.4, run the following commands:

    cat > ~/.xinitrc << "EOF"
    dbus-launch --exit-with-x11 $KF6_PREFIX/bin/startplasma-x11
    EOF

    startx

The X session starts on the first unused virtual terminal, normally vt7. You can switch to another vtn simultaneously pressing the keys Ctrl-Alt-Fn (n=1, 2, ...). To switch back to the X session, normally started at vt7, use Ctrl-Alt-F7. The vt where the command startx was executed will display many messages, including X starting messages, applications automatically started with the session, and eventually, some warning and error messages. You may prefer to redirect those messages to a log file, which not only will keep the initial vt uncluttered, but can also be used for debugging purposes. This can be done starting X with:

    startx &> ~/x-session-errors

When shutting down or rebooting, the shutdown messages appear on the vt where X was running. If you wish to see those messages, simultaneously press keys Alt-F7 (assuming that X was running on vt7).

## Contents

Installed Programs: There are too many plasma programs (over 50 in /opt/kf6/bin) to list separately here.
Installed Libraries: There are too many plasma libraries (over 250 in /opt/kf6/lib) to list separately here.
Installed Directories: There are too many plasma directories (over 2700 in /opt/kf6) to list separately here.

- Prev

  kquickimageeditor-0.6.0

- Next

  GNOME

- Up
- Home