Bring Windows XP themes to your KDE Plasma environment! xplasma.hotsocket.fyi
README.md

XPlasma #

Windows XP visual styles, natively, on KDE Plasma. The sequel to xp2plasma.

Point it at a Windows XP .msstyles (Luna, Royale, Royale Noir, Zune, Embedded, or any of the fan styles) and it themes the whole Plasma desktop from it: window decorations, taskbar and Start menu, tray, fonts, colours, wallpaper, icons, and every Qt application's widgets, drawn by a native Qt style that reads the .msstyles itself.

Status: the style is done to the pixel against real XP (see PLAN.md and NOTES.md). The app around it -- the XPlasma Properties editor, the generators, setup and the CLI -- is C++/Qt 6 on the same core, rewritten from the Python xp2plasma carried.

Layout #

Path What
src/core/ The .msstyles reader (PE, DIB, INI cascade, schema) and the renderer, pixel-exact against XP; .theme files and Windows Classic schemes (NONCLIENTMETRICS, LOGFONT).
src/style/ The Qt 5/6 style plugin, drawing every widget from the core.
src/app/ The app: the library under everything (archives, host programs, state, the theme library, the generators, apply and reset, setup), the xplasma CLI and the xplasma-edit editor (editor/). data/schemes/ holds XP's 36 stock Classic schemes, decoded from its HIVEDEF.INF by xplasma-schemes.
src/app/start-menu/ XPlasma's Start plasmoid (fyi.hotsocket.xplasma.start): the Start button and XP's menu on Plasma's own application models. Only its data changes with the look.
src/third_party/ libarchive, built static and linked in (ZIP, RAR, 7z, TAR, XP's CAB-compressed files).
src/tools/ xplasma-render (reference renders, --export), xplasma-dump, xplasma-gallery, xplasma-probe, and xplasma-icons-sheet (XP icon/toolbar contact sheets).
tests/core/ The core's unit test and fuzz targets, with their vectors.
tests/app/ QtTest for the app.
tests/reference/ Dev tooling (Python) that holds the style against the Windows XP reference VM (styles_matrix.py, …).
refharness/ The programs that run inside the XP VM and dump what real uxtheme draws.
cmake/sdk/, cmake/qt5-moc/, cmake/toolchains/ The Linux release build's pinned SDK, its host tools and its Clang cross toolchain.
project.ini The project's own settings: its release number (a whole number, one up per release: Setup offers Update over a lower one), its issue tracker, where it checks for a newer XPlasma, and the Internet Archive. The build writes them into app/project.h.
docs/xp2plasma/ xp2plasma's README and visual notes, kept for reference.

Building #

The normal build uses the host's Qt and KDE development packages on either FreeBSD or Linux; no container or Linuxulator is needed. CMake and Ninja are required. build.sh, install.sh and package.sh always take a target; none has a default. Build only the app and styles with ./build.sh native, or name the Plasma series whose patched widgets should be included in the same staging tree:

$ ./build.sh native 6.7        # use the series reported by plasmashell --version
$ ./install.sh native          # install the staged tree into ~/.local

build/native/ is replaced only after the requested builds succeed. It contains exactly the requested Plasma series, not every old fork output under build/plasma/. Run ./build.sh native without a series to stage just the app and styles. build-forks.sh SERIES... also builds the widget outputs on its own, but does not change the staged tree. The widget builds are tied to the host's Qt/KDE versions and need rebuilding after those libraries change. QT_MAJORS=6 ./build.sh native is a Qt 6-only iteration, not a complete install; install.sh requires both Qt style plugins. An app/style-only install leaves previously installed widget forks in place; pass a series to rebuild and replace them.

On FreeBSD, install the Qt 5/6 and Plasma development packages and:

# pkg install cmake ninja qt5-qmake qt5-buildtools kf6-extra-cmake-modules intltool

On Linux, use the distribution's matching Qt 5/6 and KDE/Plasma development packages plus CMake and Ninja for the normal native build.

The Linux release build (work in progress) #

The linux mode builds the Qt 6 app and Qt 6/5 style plugins as Linux x86_64 programs, the same way on FreeBSD or Linux, and without running any Linux program. The host needs only LLVM (Clang, LLD and its binary tools), CMake 3.24+, Ninja and Python 3 (KDE's build of Plasma's widgets runs a Python script of its i18n):

# pkg install llvm19 cmake ninja python3                     # FreeBSD
# zypper install clang lld llvm cmake ninja python3         # openSUSE (other distributions alike)
$ ./build.sh linux

Clang is one compiler for every target, but it must bring its own stddef.h and the like (glibc expects them from the compiler), which FreeBSD's base Clang leaves out: hence a ports LLVM there. build.sh picks the first suitable Clang on PATH, or the one XPLASMA_HOST_CC names, and uses the llvm-objdump beside it for check-abi.sh. FreeBSD (Clang 19) and openSUSE (Clang 23) both build it, and the Qt 6 style built on FreeBSD loads into openSUSE's Qt 6.11.

Everything else is pinned, with its SHA-256, under cmake/sdk/, and build.sh fetches and builds it into the ignored build/sdk/. The first run takes a while (Qt's tools are built from source: see docs/build-times.md); after that a run with nothing new takes seconds.

  • the base (linux-x86_64.sources, linux.cmake), for the app and the styles: a sysroot of Rocky 9's glibc 2.34 and GCC 11 runtime, and Qt's own Linux binaries of 6.8.3 and 5.15.2; Qt 6.8.3's code generators, built from source with the same Clang, and Qt 5.15.2's moc, built by cmake/qt5-moc/ (Qt 5's own build wants make and Perl).
  • one SDK per Plasma series (plasma-SERIES.sources, plasma.cmake), for its widget forks: Rocky's base plus Arch Linux's KDE, Plasma and libraries from the Arch Linux Archive snapshot forks.json names, and Qt at the series' oldest supported version (from an earlier snapshot when needed); host builds of exactly that Qt, of KConfig's compiler and wayland-scanner at the snapshot's versions, and of pkgconf (cmake/pkgconf/, cmake/wayland-scanner/, with expat). Its tools.cmake binds a fork build to those tools.

The host is kept out: host tools may link only the host's base system (libc, libm, the C++ runtime) and what the SDK built, and are checked; Qt's are built with every optional system library off, and with only what the build tools need: Core, Gui, D-Bus and QML's compiler, no QtQuick (a third of the full build); the app's host Qt also keeps Widgets and Network, for the CLI built for the host. Every sysroot is pruned to what a build reads and made non-executable, and a series' sysroot is fixed up so nothing in it points at the host -- absolute symlinks, CMake packages naming /usr paths, one package's prefix bug, requests for a newer Qt than the series' -- and then checked for exactly that. cmake/sdk/resolve-plasma.cmake -DSERIES=6.8 (by hand, when a series moves to another snapshot) works out a series' packages and pins them.

The oldest Plasma XPlasma supports is the one Debian stable ships: Plasma 6.3 on Debian 13 today (project.ini's OldestPlasma, which Setup's check and the download page use). When a new Debian stable comes out, its Plasma becomes the oldest supported one, and the Qt floor can move up to its Qt. Qt 6.8 is Debian 13's Qt, so it's the Qt the app and styles are built against.

Wayland is the session XPlasma is made for. X11 is second-class at best: it gets the same install and should work, but parts of it are noticeably worse there, and an X11-only problem doesn't hold anything up.

./build.sh linux builds the app and both styles into build/linux-qt{6,5}/ and runs check-abi.sh on them, then cross-builds every series' widget forks (cmake/forks.cmake) into build/linux-forks/SERIES/out/: each series' Plasma source, patched by xplasma-forktool fork-sources (built for the host against the SDK's Qt, -DXPLASMA_HOST_TOOL=ON: the fork catalogue and the patching on Qt Core alone, so other app changes don't rebuild it), configured with the series' tools.cmake, XPlasma's targets only. A series' plugins are put out only if every one uses public Qt API alone, nothing past the series' oldest Qt, and glibc 2.34 at most. Then it stages the release into build/linux/ -- the app, both styles and every series' forks, or nothing (QT_MAJORS=6 builds, but doesn't stage) -- and ./package.sh linux makes build/XPlasma-Setup-Linux-x64 of it, refusing a tree that lacks any series in forks.json. No Linux binary is executed on FreeBSD.

Complete builds stage into build/<mode>/: bin/xplasma (the CLI), bin/xplasma-edit (XPlasma Properties), style plugins in lib/xplasma/qt{6,5}/styles/, and desktop entries. The app uses Qt 6; the style is built for both majors. Archives (the XP ISO, its CAB-compressed files, the theme packs' ZIPs) are read by the linked-in libarchive and XPlasma's own ISO 9660 reader.

A plugin built against Qt 6.N loads into every Qt ≥ 6.N, provided it uses only public Qt API and binds nothing else to Qt (the 6.6.3 build runs on the host's 6.9.1 and in PySide6's 6.11.2; the 5.15.2 build on 5.15.17). check-abi.sh enforces that on every release build: no private Qt symbols, no non-Qt symbol bound to a Qt version (the Qt Company's 5.15 binaries export sized operator delete, which is why libstdc++ is linked first), only the plugin entry points exported, glibc no newer than 2.34.

$ QT_PLUGIN_PATH=$PWD/build/native/lib/xplasma/qt6 build/native-qt6/xplasma-probe --out /tmp/probe.png
$ QT_PLUGIN_PATH=$PWD/build/native/lib/xplasma/qt6 dolphin -style XPlasma
$ XPLASMA_SAFE=1 …    # the plugin draws nothing of its own (classic only)

Installing and running #

The one file to hand out is XPlasma-Setup-Linux-x64, a Windows Installer–style wizard with XPlasma packed inside it (a self-extracting archive; nothing of Windows ships in it: its look is XPlasma's own Classic drawing, its pictures its own). Run, it downloads Windows XP from the Internet Archive (or uses the copy already downloaded), takes out what XPlasma uses, installs XPlasma into ~/.local, installs XP's pointer schemes as cursor themes, and offers to launch XPlasma. Choosing a look is XPlasma Properties' job, never the wizard's. Run again, it repairs or removes XPlasma.

$ ./build.sh linux && ./package.sh linux   # build/XPlasma-Setup-Linux-x64

From a checkout, for development:

$ ./install.sh native [PREFIX]   # PREFIX defaults to ~/.local
$ xplasma setup --download-media         # or --media PATH/TO/XP.iso (or its I386 folder)
$ xplasma check                          # whether this desktop can take the XP look (--json for Setup)
$ xplasma list                           # the styles, themes and Classic schemes it found
$ xplasma apply ~/.local/share/xplasma/Windows/Themes/Luna/Luna.theme
$ xplasma apply 'classic:Windows Standard'   # LOOK: a .msstyles[:VARIANT_INI], a .theme, or classic:SCHEME
$ xplasma reset                          # back to Plasma's own look
$ xplasma-edit                           # XPlasma Properties: Themes, Desktop, Appearance, Pointers, Sounds (also in the app menu)
$ xplasma-edit --date-time               # Date and Time Properties (double-click the clock)
$ xplasma-edit --sounds                  # ... opened on its Sounds tab: XP's sound schemes
$ xplasma-edit --reapply                 # ... applying the look again if an older XPlasma made it (Setup, after an update)
$ xplasma-edit --check-updates --now     # XP's update globe, if project.ini's UpdatesUrl names a higher release number (run at login)
$ xplasma sounds 'Windows Default'       # or 'No Sounds', a saved scheme, or off (kept off by later applies)

From Plasma 6.5 on, Plasma builds some of its widgets (the tray, notifications, the task manager) into their plugins, where a home-folder copy can't stand in for them. XPlasma builds its own from Plasma's source, one per Plasma series, against this host's installed development libraries:

$ ./build.sh native 6.7        # build and stage this host's series, then ./install.sh native
$ ./build-forks.sh 6.7        # build the fork output alone, without staging

Apply installs the build that loads in the running Plasma, or refuses the whole look if none does. After a Plasma upgrade to another series, a check at login (xplasma check-forks, from XPlasma's plasma-workspace env script) swaps in that series' build, or takes XPlasma's off so Plasma's own widgets come back, before Plasma's shell starts.

Flatpak's Qt 6 apps are styled too: apply puts the style plugin into each installed KDE runtime (6.x) as an org.kde.KStyle.XPlasma extension -- a plain folder under ~/.local/share/flatpak/extension, nothing to build or download -- and lets every app read the look (~/.local/share/xplasma/active, read-only, through the user's global Flatpak override). A runtime installed later gets it at the next login; reset takes both back out (src/app/flatpak.cpp).

GTK 3 and GTK 4 apps get a generated theme (~/.local/share/themes/XPlasma-*, on GTK's own Adwaita, with XP's controls as images XPlasma's Qt style draws), switched to through Plasma's GTK settings; libadwaita apps, which ignore themes, get the XP layer through ~/.config/gtk-4.0/gtk.css (src/app/gtk.cpp).

XPlasma adopts what xp2plasma already imported on a machine (the asset library, saved schemes, the downloaded XP media) instead of fetching it again: it moves them into its own places on first run, leaving symlinks behind (src/app/adopt.cpp). Nothing Microsoft-copyrighted is in this repository.

The Start menu's Turn Off Computer opens XP's chooser: Stand By, Turn Off, Restart, and Cancel. Hold Shift for Hibernate when supported. The art comes from the user's XP media; KDE handles the chosen session action. On X11, the desktop freezes and fades to grayscale, with keyboard and pointer input held by the chooser until Cancel, Escape, or a power choice. The same chooser runs on KDE Wayland using KWin screenshots and one LayerShellQt overlay per monitor. Wayland builds need LayerShellQt development files; without them, the chooser remains available without the desktop effect. Install the desktop entries as well as the binary: KWin uses them to authorize screenshot access. Compositor-reserved shortcuts remain under KWin’s control. After updating an existing installation, reapply the look to generate the new dialog assets and update the Start plasmoid.

Tests #

$ build/native-qt6/test-core                               # the core
$ build/native-qt6/tests/app/test-app                      # the C++ app (run on the host to include the XP ISO)
$ build/native-qt6/tests/app/test-startmenu                # the Start menu's QML, drawn offscreen
$ QT_QPA_PLATFORM=offscreen build/native-qt6/tests/app/test-powerprompt  # shared power chooser
$ tests/app/plasmoid_smoke.sh THEME.json                    # the Start plasmoid loaded by Plasma (host only)
$ QT_QPA_PLATFORM=offscreen build/native-qt6/src/app/xplasma-edit --screenshots OUT
$ tests/reference/styles_matrix.py OUT                     # the style against real XP (needs refharness/vm.sh)
$ ./fuzz.sh [SECONDS]                                   # the core's parsers under libFuzzer (FreeBSD's base Clang has it)

Tests that need the official styles or the XP media find them where setup imported them, and skip when they are absent. Optional Python reference tools use python3 -m venv --system-site-packages .venv && .venv/bin/pip install -r requirements-dev.txt (the system's site-packages for vboxapi, which VirtualBox installs: the XP VM is driven through it); the C++ contact-sheet tool below needs no Python packages.

To identify XP resources by eye, use the C++ contact-sheet tool (built with the app; it reads your XP media through the same PE and bitmap decoders):

$ QT_QPA_PLATFORM=offscreen build/native-qt6/src/app/xplasma-icons-sheet shell32.dll /tmp/icons.png 130-160
$ QT_QPA_PLATFORM=offscreen build/native-qt6/src/app/xplasma-icons-sheet shell32.dll /tmp/toolbar.png --bitmaps 214 216

The first sheet labels icon-group IDs; --bitmaps divides toolbar strips into square glyphs labelled resource:zero-based-cell (for example 214:28 is Explorer's Up button). Pass an XP DLL path instead of shell32.dll to inspect a file outside the imported media cache. This is a dev tool and isn't installed with XPlasma.

CI #

The release job is ci/release.sh, for whatever runs it (a self-hosted runner, cron, a person) on a FreeBSD or Linux machine with what ./build.sh linux needs: ./build.sh linux, the tests, ./package.sh linux, then with PUBLISH=1 ci/publish.sh onto the download site (that needs Rust's cargo besides, once). The tests are the cross-built Linux programs: they run in place on a Linux machine, or on XPLASMA_TEST_HOST (an ssh destination: a Linux machine with Qt 6.8 or newer) from elsewhere; without either, the job says it skipped them. Jenkinsfile runs it on Jenkins, from Tangled's push webhook, with the SDKs kept in JENKINS_HOME.

$ XPLASMA_TEST_HOST=tester@linux-box ci/release.sh       # build, test, package
$ PUBLISH=1 WISPCTL_APP_PASSWORD=... ci/release.sh       # and publish a new release

The download site is a wisp.place site at UpdatesUrl's address (https://xplasma.hotsocket.fyi), and only ever the newest release: index.html (ci/site/index.html), latest.json -- what the update check reads: the version, the page, project.ini's Notes, the installer's SHA-256 -- and XPlasma-Setup-Linux-x64. ci/site.cmake makes them, and only when project.ini's Version is newer than the site's, so a publish of a build that isn't a new release does nothing. wispctl (pinned) is built from source into the SDK's host tools the first time: it has no FreeBSD binary. WISPCTL_APP_PASSWORD is an app password of the account the site belongs to (WISP_HANDLE, default hotsocket.fyi; WISP_SITE, default xplasma).

From release 2 on, the update feed is on the project's own domain, so the host can change without stranding an install. (Release 1 was built with a Tigris bucket's address that never served a feed: it shows no update.)

A release, then: Version one higher and new Notes in project.ini, committed and pushed.

Licence #

XPlasma is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version (LICENSE). Its files say so in their SPDX-License-Identifier lines; the QML snippets pasted into KDE's own files (src/app/overrides/, those without the line) are under the same terms.

What its programs carry from others -- libarchive, bzip2, and the builds of KDE Plasma's widgets under their own licences -- is listed with their notices in THIRD-PARTY-NOTICES, installed beside the licence in share/licenses/xplasma/ and viewable from XPlasma Properties' About tab.

Windows and Windows XP are trademarks of Microsoft Corporation, which neither makes nor endorses XPlasma. XPlasma includes none of Windows' files: it takes what it uses from the user's own Windows XP CD image.