A KDE Plasma 6 panel pager that shows what each virtual desktop actually looks like — on Wayland, where live thumbnails are impossible.
Plasma's built-in Pager draws window outlines. KDE 3's KPager rendered live desktop contents, but that died with X11's ability to grab pixmaps from unmapped windows: on Wayland, windows on inactive desktops simply aren't composited, so nothing can render them live. SnapPager takes the pragmatic way out: it screenshots each desktop at the moment you leave it and shows those cached snapshots as clickable tiles.
Two parts:
- Capture daemon (
capture/snappager-capture.sh) — a ~40-line bash script run as a systemd user service. It watches KWin'sVirtualDesktopManager.currentChangedD-Bus signal viabusctl monitorand, on every switch, waits 0.5 s for the animation to settle and shoots the screen withspectacle, saving to~/.cache/deskpager/<desktop-uuid>.png. - Plasmoid (
plasmoid/) — a small QML widget that shows one tile per virtual desktop (viaTaskManager.VirtualDesktopInfo), reloads its images 1 s after each desktop switch, highlights the current desktop, and switches desktops on click (D-Bus property write to KWin).
Fast-swipe correctness: spectacle photographs whatever is on screen now, so a capture queued for a desktop you merely flew past would record the desktop you landed on instead. The daemon re-checks the current desktop before and after each shot and discards mismatches — fly-past desktops keep their last good snapshot.
- A tile shows a desktop as you last left it — not live. New windows, notifications, etc. on background desktops don't appear until you next visit.
- The current desktop's own tile is one visit stale (you can't screenshot a desktop you're not on... and the one you're on is right in front of you). It's marked with a highlight border instead.
- Captures are full-screen: on multi-monitor setups the tile shows all screens squeezed into one 16:9 tile.
- KDE Plasma 6 on Wayland
spectacle,qdbus,busctl(all standard on a Plasma 6 install)
# plasmoid
kpackagetool6 --type Plasma/Applet --install plasmoid
# capture daemon
install -Dm755 capture/snappager-capture.sh ~/.local/bin/snappager-capture.sh
install -Dm644 systemd/snappager-capture.service ~/.config/systemd/user/snappager-capture.service
systemctl --user daemon-reload
systemctl --user enable --now snappager-capture.serviceThen add the Desktop Pager (Screenshots) widget to your panel (right-click panel → Add Widgets). Upgrading later: kpackagetool6 -t Plasma/Applet --upgrade plasmoid.
Install the plasmoid per above (it's per-user), and declare the daemon in configuration.nix:
systemd.user.services.snappager-capture = {
description = "SnapPager desktop screenshot capture";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
# NB: the path option appends /bin itself
path = [ "/run/current-system/sw" ]; # qdbus, busctl, spectacle
serviceConfig = {
ExecStart = "${./capture/snappager-capture.sh}";
Restart = "on-failure";
RestartSec = 2;
};
};- Capture settle delay:
sleep 0.5in the capture script. - Tile reload delay after a switch:
interval: 1000inplasmoid/contents/ui/main.qml. - Tile aspect ratio:
height * 16 / 9inmain.qml.
GPL-2.0-or-later.
