Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

354.3. kscreenlocker-6.8.2

Plasma's screen locker: the locking library KWin links, the PAM unlock greeter and the Screen Locking settings page

Version 6.8.2, release 1
Shelf kde — KDE Plasma and Gear platform pieces outside Frameworks that have no other domain: KIO workers, thumbnailers, Plasma integration, KDE Wayland glue
Phase 50_desktop (Desktop), 3 of 92 in build order
Licence GPL-2.0-or-later AND (LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL) AND (GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL) AND CC0-1.0 AND LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause
Homepage https://invent.kde.org/plasma/kscreenlocker
Build time 2.2 SBU
Installed size 1.3 MiB in 34 files
Recipe ports/core/kde/kscreenlocker/kpkgbuild

About

KScreenLocker is the Plasma lock screen. libKScreenLocker is the locking side, which kwin links: it locks after the idle time set in kscreenlockerrc, when the session is told to (org.freedesktop.ScreenSaver.Lock, loginctl lock-session, the lock shortcut), and before the machine sleeps, and it keeps the session locked until the greeter reports success. The greeter, /usr/lib/libexec/kscreenlocker_greet, draws the unlock screen over every output from the lock-screen QML of the current Plasma look-and-feel package, falling back to a plain theme compiled into it. It checks each attempt through kscreenlocker_worker, a helper that runs one PAM conversation and runs as the user, not as root. The Screen Locking page of System Settings (kcm_screenlocker) is also part of the port.

Why it is in KDOS

The comment above it in script/phases/50_desktop/packages.txt:

The lock screen: the library KWin links and the PAM unlock greeter.

Sources

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, kcrash, kcmutils, kio, kglobalaccel, ki18n, kidletime, knotifications, solid, kwindowsystem, kxmlgui, ksvg, kconfig, kcoreaddons, kpackage, kdeclarative, kirigami, libplasma, layer-shell-qt, libkscreen, pam, elogind.

Required by (4): kde-plasma, kwin, plasma-desktop, plasma-workspace.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/50_desktop/phase.env && kpkg install kscreenlocker'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/kde/kscreenlocker.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/kde/kscreenlocker
echo '24538edbdb72840bbfaf5e4e4fce40f25029a46dd0e35277317be95211f7f968  kscreenlocker-6.8.2.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/kscreenlocker
SRC=$SRC_ROOT/kscreenlocker-6.8.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf kscreenlocker-6.8.2.tar.xz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D BUILD_TESTING=OFF \
	-D KF_SKIP_PO_PROCESSING=ON \
	-D KSCREENLOCKER_PAM_PASSWORD_SERVICE=kde \
	-D KSCREENLOCKER_PAM_FINGERPRINT_SERVICE=kde-fingerprint \
	-D KSCREENLOCKER_PAM_SMARTCARD_SERVICE=disabled \
	-D KSCREENLOCKER_PAM_FACE_SERVICE=disabled \
	-D KSCREENLOCKER_PAM_UNIVERSAL2FACTOR_SERVICE=disabled \
	-D CMAKE_REQUIRE_FIND_PACKAGE_loginctl=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
install -vdm755 "$PKG/etc/pam.d"
cat > "$PKG/etc/pam.d/kde" << "EOF_PAM"
# Begin /etc/pam.d/kde
auth      include    system-auth
account   include    system-account
# End /etc/pam.d/kde
EOF_PAM

cat > "$PKG/etc/pam.d/kde-fingerprint" << "EOF_PAM"
# Begin /etc/pam.d/kde-fingerprint
auth      required   pam_fprintd.so
account   include    system-account
# End /etc/pam.d/kde-fingerprint
EOF_PAM
chmod 644 "$PKG/etc/pam.d/kde" "$PKG/etc/pam.d/kde-fingerprint"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/kscreenlocker, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf kscreenlocker-6.8.2-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/kscreenlocker, and runs the triggers its paths call for.

Contents

Installed libraries: libKScreenLocker.so.

Installed directories: /usr/include/KScreenLocker, /usr/lib/cmake/KScreenLocker, /usr/lib/cmake/ScreenSaverDBusInterface, /usr/lib/qt6/qml/org/kde/kscreenlocker, /usr/share/licenses/kscreenlocker.

Notes

build.sh writes the lock screen’s two PAM stacks, /etc/pam.d/kde and /etc/pam.d/kde-fingerprint. kscreenlocker runs only the auth phase, pam_authenticate and then pam_setcred with PAM_REFRESH_CRED, and never account or session, so kde is system-auth’s auth lines and nothing else that would run. pam_kwallet5 is not in it: its auth phase only keeps the password for a session phase, and a lock screen has none, so an unlock opens no wallet. pam_unix checks the password through the setuid unix_chkpwd that pam installs, which is how a worker running as the user reads /etc/shadow. system-auth carries nullok, so an account with no password, such as the live medium’s, unlocks with an empty field. kde-fingerprint is the fingerprint authenticator’s service, used only when it is turned on in kscreenlockerrc [Authenticators] Fingerprint; pam_fprintd is required, so a reader that is absent or a finger that does not match fails the attempt rather than falling through. It names pam_fprintd.so, which fprintd installs; without fprintd the stack fails closed, so fprintd is not in depends.

The session is tracked by elogind over org.freedesktop.login1: the locker listens for the session’s Lock and Unlock signals and for PrepareForSleep, and holds a sleep delay inhibitor so that the lock is drawn before the machine suspends. If the greeter crashes, the locker keeps the session locked behind a black window that tells the user to switch to another virtual terminal, log in and run loginctl unlock-session <id>.

The fallback theme imports org.kde.plasma.private.sessions from plasma-workspace, which also provides the look-and-feel package whose lock screen the greeter normally draws; plasma-workspace depends on this port, so it is not named in depends. The other QML modules the fallback theme and the settings page import at run time come from kirigami, kdeclarative (org.kde.kquickcontrols and org.kde.kquickcontrolsaddons), kcmutils, ksvg and libplasma.