Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnapPager

A KDE Plasma 6 panel pager that shows what each virtual desktop actually looks like — on Wayland, where live thumbnails are impossible.

SnapPager in a panel: one screenshot tile per virtual desktop, current desktop highlighted

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.

How it works

Two parts:

  1. Capture daemon (capture/snappager-capture.sh) — a ~40-line bash script run as a systemd user service. It watches KWin's VirtualDesktopManager.currentChanged D-Bus signal via busctl monitor and, on every switch, waits 0.5 s for the animation to settle and shoots the screen with spectacle, saving to ~/.cache/deskpager/<desktop-uuid>.png.
  2. Plasmoid (plasmoid/) — a small QML widget that shows one tile per virtual desktop (via TaskManager.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.

Limitations (by design)

  • 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.

Requirements

  • KDE Plasma 6 on Wayland
  • spectacle, qdbus, busctl (all standard on a Plasma 6 install)

Install

Generic (any distro)

# 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.service

Then add the Desktop Pager (Screenshots) widget to your panel (right-click panel → Add Widgets). Upgrading later: kpackagetool6 -t Plasma/Applet --upgrade plasmoid.

NixOS

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;
  };
};

Tuning

  • Capture settle delay: sleep 0.5 in the capture script.
  • Tile reload delay after a switch: interval: 1000 in plasmoid/contents/ui/main.qml.
  • Tile aspect ratio: height * 16 / 9 in main.qml.

License

GPL-2.0-or-later.

About

Screenshot-based virtual desktop pager for KDE Plasma 6 on Wayland — see what's on each desktop, not just window outlines

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages