https://github.com/longregen/fastshot.git
A screenshot utility for KDE Plasma 6 on Wayland. Captures screenshots via KWin's D-Bus interface and saves them as PNG files.
fastshot [output.png]
Takes a screenshot of the active screen and saves it. If no filename is provided, uses timestamp format YYYY.MM.DD-HH.MM.SS.png.
fastshot --loop [options]
Runs continuously, taking screenshots at regular intervals. Only saves when the screen content has changed beyond the similarity threshold.
Options:
| Option | Description | Default |
|---|---|---|
--loop | Enable continuous screenshot mode | - |
-d, --directory DIR | Output directory | ~/desktop-record |
-i, --interval SECS | Seconds between captures | 45 |
-t, --threshold FLOAT | Similarity threshold (0-1). Only saves if similarity is below this value | 0.99 |
-v, --verbose | Enable verbose logging | off |
-h, --help | Show help | - |
fastshot --loop --directory ~/screenshots --interval 10 --threshold 0.95
This captures every 10 seconds and saves only when the screen differs by more than 5% from the last saved image.
A NixOS module is provided for running fastshot as a user service.
{
imports = [ ./path/to/fastshot/module.nix ];
services.fastshot = {
enable = true;
user = "alice"; # required: user to run the service for
directory = "screenshots"; # relative to $HOME
interval = 30;
threshold = 0.99;
verbose = false;
};
}
The service runs as a systemd user unit, starting after graphical-session.target. The user option restricts the service to only run for the specified user.
nix build
Or enter a development shell:
nix develop
cd src
gcc -O3 -mavx2 fastshot.c image-compare.c \
$(pkg-config --cflags --libs libsystemd libpng) \
-o fastshot
Requires: gcc, pkg-config, libsystemd-dev, libpng-dev
org.kde.KWin.ScreenShot2.CaptureActiveScreen to capture the screensrc/fastshot.c - main programsrc/image-compare.c - SIMD-optimized image comparisonmodule.nix - NixOS service moduledefault.nix - Nix package definitiontests/vm.nix - NixOS VM integration testMIT