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

354.16. powerdevil-6.8.2

KDE power management — idle dimming and suspend, lid and power-key policy, brightness, the battery applet and the Power settings

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), 39 of 92 in build order
Licence GPL-2.0-or-later AND LGPL-2.0-only AND LGPL-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 AND GPL-3.0-or-later
Homepage https://invent.kde.org/plasma/powerdevil
Build time 2.6 SBU
Installed size 6.4 MiB in 70 files
Recipe ports/core/kde/powerdevil/kpkgbuild

About

PowerDevil is Plasma’s power manager. Its daemon, org_kde_powerdevil, dims and blanks the screen when the session is idle, suspends or powers off on the idle, lid, power-key and low-battery events its profiles name, sets screen and keyboard brightness, and switches the power profile. It also installs the battery and brightness applet, the Power Management settings module and a KRunner plugin for the same controls. The suspend and power-off themselves, and the inhibitors that keep the lid and the power key away from the system’s own handling while a session runs, go through org.freedesktop.login1, which elogind serves.

Why it is in KDOS

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

Power management: idle dimming and suspend, lid and power-key policy, brightness and the battery applet.

Sources

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, pkgconf, qt6-qtbase, qt6-qtdeclarative, qt6-qtwayland, qcoro, kauth, kcmutils, kconfig, kcoreaddons, kcrash, kdbusaddons, kdoctools, kglobalaccel, ki18n, kidletime, kio, kirigami, kirigami-addons, kitemmodels, knotifications, kpackage, krunner, kservice, solid, kwindowsystem, kxmlgui, libplasma, plasma-activities, libkscreen, plasma-workspace, plasma-wayland-protocols, wayland, eudev, ddcutil, upower, polkit, elogind, tlp-pd.

Required by (1): kde-plasma.

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 powerdevil'

What kpkg does

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

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/powerdevil
echo 'c663355adcfdfafe9824f48aa15881679fd71b0b16863a603a62ec0bce628d4a  powerdevil-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/powerdevil
SRC=$SRC_ROOT/powerdevil-6.8.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf powerdevil-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 CMAKE_REQUIRE_FIND_PACKAGE_DDCUtil=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_KF6DocTools=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
rm -rf "$PKG/usr/lib/systemd"

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/powerdevil, 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 powerdevil-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/powerdevil, and runs the triggers its paths call for.

Contents

Installed libraries: libpowerdevilcore.so.

Installed directories: /usr/lib/qt6/plugins/powerdevil, /usr/lib/qt6/qml/org/kde/plasma/private/batterymonitor, /usr/lib/qt6/qml/org/kde/plasma/private/brightnesscontrolplugin, /usr/share/doc/HTML/en/kcontrol/powerdevil, /usr/share/licenses/powerdevil.

Notes

plasma_session starts the daemon from the XDG autostart entry /etc/xdg/autostart/powerdevil.desktop, phase 0. The install also puts a systemd user unit under /usr/lib/systemd, which the package lint refuses (see What the package lint refuses); build.sh removes the directory. The entry carries X-systemd-skip=true, which only a systemd session reads.

The power profile switch, in the battery applet and in the settings, calls org.freedesktop.UPower.PowerProfiles on the system bus and nothing else. tlp-pd serves that name over TLP’s own profiles. With no provider the applet shows no switch and tells the user to install power-profiles-daemon, which is not a port. Battery levels and the AC state come from upower through Solid. Both are in depends for run time, with elogind.

Brightness on a laptop panel is written by backlighthelper, a KAuth helper that runs as root under polkit, whose upstream policy lets the user at the active session use it without a password. Three more helpers follow the same path: chargethresholdhelper for the battery’s charge limits, discretegpuhelper and wakeupsourcehelper. polkit is in depends for run time, since without its daemon every helper call fails.

The Power settings show the battery’s charge limits only when the helper’s getthreshold action answers, and hide them when it fails. tlp writes the same sysfs files from tlp.conf each time it applies a profile, so a limit the helper wrote would last only until TLP next ran. KDOS’s polkit rules (/etc/polkit-1/rules.d/50-kdos.rules) refuse the two writes, org.kde.powerdevil.chargethresholdhelper.setthreshold and .setconservationmode, for everyone and leave the two reads at upstream’s defaults: the page shows the limits TLP set and cannot change them.

libddcutil opens the /dev/i2c-* node of each monitor’s DDC channel, so an external monitor’s brightness follows the slider only where the user can open that node. KDOS’s udev rule /etc/udev/rules.d/70-kdos-i2c.rules gives the video group read and write on the nodes whose adapter belongs to a display controller, and on no other I²C bus; the desktop user is in video.