Contributing
Plasmify is small on purpose, so contributions are easy to review. You can contribute a new preset, a bug fix or a feature.
This page is an overview. The full guide is CONTRIBUTING.md, and the preset format is described in the preset reference.
Ground rules
- No bloat. No background services, no AUR, COPR or PPA packages, no new runtime dependencies beyond Python's standard library and PyQt6. Every package a preset installs must be justified in the pull request.
- Published sources only. Assets are downloaded at apply time from where they are published. Never commit wallpapers, icon themes or cursors to the repository.
- Stock Plasma only. Layouts use widgets that ship with Plasma 6.
- Reversible. Every configuration file and generated folder Plasmify changes must be listed by its step, so that Restore can undo it. Downloads are left to
plasmify clean.
Development setup
git clone https://github.com/heyquatch/plasmify.git
cd plasmify
# Install Python, PyQt6 and git for your distribution:
# Arch: sudo pacman -S --needed python python-pyqt6 git
# Fedora: sudo dnf install python3 python3-pyqt6 git
# openSUSE: sudo zypper install python3 python3-PyQt6 git
# Debian/Ubuntu: sudo apt install python3 python3-pyqt6 git
PYTHONPATH=src python -m plasmify gui # run the window from the checkout
PYTHONPATH=src python -m plasmify --help # or the command line
Try changes that touch your desktop with --dry-run first, for example PYTHONPATH=src python -m plasmify apply nord-minimal --dry-run.
Tests and checks
Before opening a pull request, run:
PYTHONPATH=src python -m unittest discover -s tests -t . # unit tests
PYTHONPATH=src python -m plasmify validate # all built-in presets
ruff check . && ruff format --check . # lint (pip install ruff)
PYTHONPATH=src python scripts/check_packages.py # package names exist on your distribution
shellcheck install.sh
Continuous integration runs the unit tests on Python 3.11, 3.12 and 3.13, validates the presets, builds the main window offscreen, and checks the package names against the real package managers of Arch, Fedora, openSUSE, Debian and Ubuntu in containers.
Fuzzers
- GUI fuzzer (
tests/test_gui_fuzz.py): clicks through the Customize tab in a seeded random order and checks after every action that nothing raised, the settings are valid, Apply never uses an outdated plan and saved tweaks survive a reload. When you touch the GUI, run it longer and with other seeds:PLASMIFY_FUZZ_STEPS=3000 PLASMIFY_FUZZ_SEED=7 QT_QPA_PLATFORM=offscreen PYTHONPATH=src:. python -m unittest tests.test_gui_fuzz - Security fuzzer (
tests/test_security_fuzz.py): hostile text in every free-text field must leave every generated config file, script and QML file with exactly its normal structure. - Bundle fuzzer (
tests/test_bundle_fuzz.py): hundreds of corrupted and malicious bundles must be refused cleanly and never write outside the preset folder. - Panel script tests (
tests/test_layout_script.py): every combination of panel options and hundreds of random layouts run against a mock of Plasma's scripting API.
All of these run as part of the normal unit test command above (the GUI tests are skipped when PyQt6 is not installed). The sandbox tests below are skipped unless you opt in.
The Plasma sandbox
Anything that touches panels, wallpapers, the splash screen or Plasma shell restarts must be tried in the sandbox: a throwaway Plasma desktop that cannot touch yours. tools/sandbox.py starts a nested KWin on an invisible screen, with its own D-Bus session, home folder and plasmashell, and takes screenshots inside it. It needs kwin_wayland, plasmashell, dbus-run-session, spectacle and qdbus6, which a full Plasma 6 desktop usually has. On some distributions Spectacle and qdbus6 (part of the Qt tools) are separate packages.
PLASMIFY_SANDBOX=1 PLASMIFY_SANDBOX_SHOTS=/tmp/shots PYTHONPATH=src:. python -m unittest discover -s tests/integration -t . -v
python3 tools/sandbox.py apply catppuccin-anime # one preset, one screenshot
- The integration tests apply, to a real
plasmashell: every subset of screen edges with bars and docks, all pairs of panel options, every widget on horizontal and vertical panels, 108 combinations of panel corner radius, opacity, border and colour, every starting layout on every preset, quick repeated applies, and every preset in full. - After each one they check that the shell is alive, that every panel has exactly the requested edge, widgets, thickness, visibility, length, alignment and floating, and that the screen is not black.
- New layout or panel style options belong in the option tables of
tests/integration/test_patterns.py. - The whole run takes about fifteen minutes and keeps screenshots in
PLASMIFY_SANDBOX_SHOTS; please look at them before you open the pull request. CI cannot run it (there is no Plasma there), so mention in the pull request that you did.
Security rules
Presets are shared between strangers, so every value in a preset is untrusted input. Read the threat model in SECURITY.md once before your first code change. In short:
- Every new preset field gets the narrowest possible check in
src/plasmify/schema.py, and an abuse case intests/test_security.py. - Paths only through
safe_child(); commands only as argument lists throughctx.runner; downloads only throughplasmify.downloads. - No new packages without review (they must be listed in
package_map.pyfor every distribution family). - Preset text is shown as plain text; no network calls outside apply; panel scripts only through
panel_script(). - Root actions live in
rootops.py, apart from package installs inpackages.py. Bundles are read only throughbundle.read_bundle().
ruff runs the flake8-bandit security rules in CI. Changes to security-sensitive files need a maintainer's review.
Adding a preset
- Copy an existing file from
src/plasmify/presets/and read the preset reference. - Use the theme's official palette and link to it in a comment.
- Pick wallpapers of at least 1920×1080 from sources that credit the artist where possible, and fill in
credit(andlicensewhen known) for every image. - Run
plasmify validate, then apply it on a real Plasma 6 session and check every step. - Open a pull request using the template. Include a screenshot and the
Installs N packages (X MB)
line shown by the app.
Testing on other distributions
Plasmify is developed on Arch-based systems. Fedora, openSUSE and Debian/Ubuntu support is implemented and the package names are checked in CI, but reports from real desktops are very welcome. Run plasmify apply <preset> --dry-run, then a real apply, and tell the project in Discussions what worked and what did not (include cat /etc/os-release and plasmashell --version).
Code changes and commits
- Code, comments, commit messages and docs are in English.
ruffenforces formatting and imports. - One logical change per pull request; add or update tests when behaviour changes.
- New steps live in
src/plasmify/steps/, subclassStepand are registered insteps/__init__.py. Usectx.runnerfor every command that changes the system, so--dry-runkeeps working. - Commit messages use the imperative mood with an optional scope, for example
presets: add Everforest Forest.
Editing this documentation
These pages are plain HTML files in docs/wiki with one shared style.css: no build step, no JavaScript and nothing loaded from the internet. The folder is published as it is at plasmify.github.io. Each page carries the same left navigation, so add a new page to every page's menu, copy the canonical and Open Graph tags from another page's head and list the page in sitemap.xml. Keep links between pages relative. Only this folder is published, so link files outside it (such as LICENSE) on GitHub. Then check the links:
python3 scripts/check_wiki.py
It reports every link in docs/wiki/*.html that points to a file (or a #section) that does not exist or lies outside the folder, a wrong canonical link and pages missing from sitemap.xml.