Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5.3 KiB
Switch Screenshot Stack to Flameshot
Date: 2026-05-02 Status: Approved
Summary
Replace the bespoke screenshot pipeline (scripts/screenshot.sh + grim/slurp/wofi/notification flow) with Flameshot. Flameshot provides region select, on-canvas annotation, save, copy, and discard in a single integrated GUI — collapsing the current two-step "capture → notification → wofi → tool" flow into one.
Current Behaviour
Mod+Print runs ~/.local/bin/screenshot which is a symlink to scripts/screenshot.sh:
slurp | grimfor region select + capture, save to~/Pictures/screenshot-<unix-ts>.png.wl-copythe file.- mako notification with thumbnail + "Actions" button (10 s timeout).
- If "Actions" clicked, wofi menu offers: Annotate (swappy), Annotate (satty), Open in imv, Copy path, Delete.
Three keypresses or clicks to reach the annotator. The notification window steals focus for 10 seconds. Two annotators offered; both must be installed.
Target Behaviour
Mod+Print runs flameshot gui. The Flameshot toolbar appears overlaid on the screen with region selector + drawing tools (arrow, rectangle, blur, text, etc.) + Save/Copy/Discard buttons. Capture, edit, and dispatch are one continuous interaction. No notification, no wofi menu, no separate annotator.
Implementation
Packages
- Add to
packages.txt:flameshot(extra repo, no AUR helper needed). - Remove from
packages.txt: none —swappy,satty,grim,slurpare kept (used by other tools or potentially useful standalone). Flameshot replaces only the orchestration script.
Files to delete
scripts/screenshot.sh~/.local/bin/screenshot(the symlink)install.shline:ln -sf "$(pwd)/scripts/screenshot.sh" ~/.local/bin/screenshot
Niri keybind change
In niri/config.kdl, replace:
Mod+Print { spawn "screenshot"; }
with:
Mod+Print { spawn "flameshot" "gui"; }
Single keybind only — no additional shortcuts for full-screen / delayed / monitor modes. Those live inside the Flameshot toolbar already.
Flameshot configuration
The flameshot config is generated by install.sh, not tracked in the repo. The pattern mirrors how mako/config is handled today — Flameshot writes machine-local state back to the file at runtime (savePath, last folder, etc.), so committing the file would create churn or risk leaking user paths into the repo.
The generated file content:
[General]
disabledTrayIcon=true
showStartupLaunchMessage=false
showHelp=false
copyAndCloseAfterUpload=true
uiColor=#81a2be
contrastUiColor=#1d1f21
contrastOpacity=190
disabledTrayIcon=true— no SNI icon (the user has no system tray on the bar).showStartupLaunchMessage=false— suppress first-run notification.showHelp=false— suppress on-canvas tooltip overlay every capture.copyAndCloseAfterUpload=true— auto-copy to clipboard when saved.uiColor/contrastUiColor— Tomorrow Night palette (@tn-blueand@tn-bgfromtheme/colors.css) so the toolbar matches the rest of the desktop.contrastOpacity=190— Flameshot's standard mid-opacity backdrop dimming during capture.
Notably NOT included:
savePath— Flameshot's INI format does not expand~, so a hardcoded/home/alex/Pictureswould break for any other user. On first save Flameshot will prompt for a destination; the user picks~/Picturesand Flameshot remembers it locally (the resulting file gets written through the symlink back into the repo, butflameshot/flameshot.iniis gitignored — see below — so it stays local).
install.sh changes
-
Remove:
ln -sf "$(pwd)/scripts/screenshot.sh" ~/.local/bin/screenshot -
Add: A here-doc generator block (mirroring the mako pattern, lines 32-42) that writes
~/.config/flameshot/flameshot.iniif the file doesn't already exist:mkdir -p ~/.config/flameshot if [ ! -f ~/.config/flameshot/flameshot.ini ]; then cat > ~/.config/flameshot/flameshot.ini <<'INI' [General] disabledTrayIcon=true showStartupLaunchMessage=false showHelp=false copyAndCloseAfterUpload=true uiColor=#81a2be contrastUiColor=#1d1f21 contrastOpacity=190 INI fiThe
if [ ! -f ]guard prevents clobbering the user's saved preferences (savePath, last folder, etc.) on re-runs. This differs from the mako block (which always overwrites) — Flameshot's config accumulates user-chosen state, so we must not stomp it.
Files Touched
packages.txt— addflameshotniri/config.kdl— change one keybind lineinstall.sh— remove one symlink line, add the flameshot config generatorscripts/screenshot.sh— deleted
Out of Scope
- Additional keybinds (full-screen, delayed, monitor) — Flameshot's toolbar already exposes these. One keybind is enough.
- Removing
swappy/satty/imv/grim/slurpfrom packages — they're useful standalone and don't carry weight. - Theming Flameshot beyond the two color values — Flameshot's UI is otherwise Qt-default and doesn't take much further customization.
- Setting
savePathdeclaratively — the INI format does not support~expansion; let Flameshot's first-save prompt handle it. - Adapting to portal limitations on Wayland — if Flameshot misbehaves under the
xdg-desktop-portal-wlrbackend, that's a Flameshot/portal issue to file upstream, not something this spec addresses.