niri: retire flameshot binds, absolute script paths in spawn-sh
Live census 2026-10-14: every flameshot mode on this box captures via xdg-desktop-portal-gnome → niri's single-output API (niri#4313) — full AND screen hang ~15 s and error docked (verified: exit 124, no file). Replace all six flameshot binds with niri-native equivalents: all-monitors script (Print/Ctrl+Shift+1/Mod+Shift+S), screenshot-screen (Alt+Print/Ctrl+Shift+2), interactive screenshot UI (Ctrl+Print/ Ctrl+Shift+3). Absolute script paths everywhere: niri's spawn-sh PATH is system-only, ~/.local/bin absent — the bare screenshot-desk.sh and desk.sh binds were silently dead. bats 27/27.
This commit is contained in:
1 parent
8da6cdc9cd
commit
d767348cfd
3 files changed
+66
-69
No files matched your search
@@ -22,7 +22,7 @@ binds {
|
|||||||
Mod+V hotkey-overlay-title="Clipboard History: noctalia panel" { spawn-sh "noctalia msg panel-toggle clipboard"; }
|
Mod+V hotkey-overlay-title="Clipboard History: noctalia panel" { spawn-sh "noctalia msg panel-toggle clipboard"; }
|
||||||
Alt+TAB hotkey-overlay-title="Window Switcher: noctalia" { spawn-sh "noctalia msg window-switcher"; }
|
Alt+TAB hotkey-overlay-title="Window Switcher: noctalia" { spawn-sh "noctalia msg window-switcher"; }
|
||||||
Mod+Shift+Space hotkey-overlay-title="Handy: toggle post-process recording" allow-when-locked=true { spawn-sh "handy --toggle-post-process"; }
|
Mod+Shift+Space hotkey-overlay-title="Handy: toggle post-process recording" allow-when-locked=true { spawn-sh "handy --toggle-post-process"; }
|
||||||
Mod+Shift+D hotkey-overlay-title="Cycle Desk Profile" { spawn-sh "desk.sh cycle"; }
|
Mod+Shift+D hotkey-overlay-title="Cycle Desk Profile" { spawn-sh "/home/blank/.omp/scripts/desk.sh cycle"; }
|
||||||
|
|
||||||
// Please set the text editor of your choice.
|
// Please set the text editor of your choice.
|
||||||
// Mod+Shift+E hotkey-overlay-title="Open Text Editor: Zed" { spawn "zed"; }
|
// Mod+Shift+E hotkey-overlay-title="Open Text Editor: Zed" { spawn "zed"; }
|
||||||
@@ -155,17 +155,19 @@ binds {
|
|||||||
Mod+M { maximize-window-to-edges; }
|
Mod+M { maximize-window-to-edges; }
|
||||||
|
|
||||||
// ─── Screenshots ───
|
// ─── Screenshots ───
|
||||||
CTRL+Shift+1 hotkey-overlay-title="Screenshot: flameshot full" { spawn-sh "flameshot full"; }
|
// flameshot retired 2026-10-14: its Wayland capture goes through
|
||||||
CTRL+Shift+2 hotkey-overlay-title="Screenshot: flameshot screen" { spawn-sh "flameshot screen"; }
|
// xdg-desktop-portal-gnome → niri's GNOME-screenshot API, which is
|
||||||
CTRL+Shift+3 hotkey-overlay-title="Screenshot: flameshot region" { spawn-sh "flameshot gui"; }
|
// single-output only (niri#4313). Verified docked: full AND screen hang
|
||||||
Print hotkey-overlay-title="Screenshot: flameshot full" { spawn-sh "flameshot full"; }
|
// ~15 s, then error bubbles; no file. Niri-native equivalents below;
|
||||||
Ctrl+Print hotkey-overlay-title="Screenshot: flameshot region" { spawn-sh "flameshot gui"; }
|
// details in omp-docs/tools/niri/screenshots.md.
|
||||||
Alt+Print hotkey-overlay-title="Screenshot: flameshot screen" { spawn-sh "flameshot screen"; }
|
// Absolute paths: niri's spawn-sh PATH lacks ~/.local/bin.
|
||||||
// Full-desk capture: one PNG per connected monitor via
|
Print hotkey-overlay-title="Screenshot: all monitors (per-monitor files)" { spawn-sh "/home/blank/.omp/scripts/screenshot-desk.sh"; }
|
||||||
// scripts/screenshot-desk.sh (symlinked into ~/.local/bin). Works docked
|
CTRL+Shift+1 hotkey-overlay-title="Screenshot: all monitors (per-monitor files)" { spawn-sh "/home/blank/.omp/scripts/screenshot-desk.sh"; }
|
||||||
// (2+ outputs), where flameshot full is dead and niri's built-in
|
Mod+Shift+S hotkey-overlay-title="Screenshot: all monitors (per-monitor files)" { spawn-sh "/home/blank/.omp/scripts/screenshot-desk.sh"; }
|
||||||
// screenshot UI selects only one output.
|
Alt+Print hotkey-overlay-title="Screenshot: focused monitor to disk" { screenshot-screen; }
|
||||||
Mod+Shift+S hotkey-overlay-title="Screenshot: all monitors (per-monitor files)" { spawn-sh "screenshot-desk.sh"; }
|
CTRL+Shift+2 hotkey-overlay-title="Screenshot: focused monitor to disk" { screenshot-screen; }
|
||||||
|
Ctrl+Print hotkey-overlay-title="Screenshot: interactive (region/window/screen)" { screenshot; }
|
||||||
|
CTRL+Shift+3 hotkey-overlay-title="Screenshot: interactive (region/window/screen)" { screenshot; }
|
||||||
|
|
||||||
// ─── Emergency Escape Key ───
|
// ─── Emergency Escape Key ───
|
||||||
// Use this when a fullscreen app blocks your keybinds.
|
// Use this when a fullscreen app blocks your keybinds.
|
||||||
|
|||||||
@@ -160,13 +160,13 @@
|
|||||||
|
|
||||||
| Key | Action |
|
| Key | Action |
|
||||||
|-----|--------|
|
|-----|--------|
|
||||||
| `CTRL+Shift+1` | Screenshot: flameshot full |
|
| `Print` | Screenshot: all monitors (per-monitor files) |
|
||||||
| `CTRL+Shift+2` | Screenshot: flameshot screen |
|
| `CTRL+Shift+1` | Screenshot: all monitors (per-monitor files) |
|
||||||
| `CTRL+Shift+3` | Screenshot: flameshot region |
|
|
||||||
| `Print` | Screenshot: flameshot full |
|
|
||||||
| `Ctrl+Print` | Screenshot: flameshot region |
|
|
||||||
| `Alt+Print` | Screenshot: flameshot screen |
|
|
||||||
| `Mod+Shift+S` | Screenshot: all monitors (per-monitor files) |
|
| `Mod+Shift+S` | Screenshot: all monitors (per-monitor files) |
|
||||||
|
| `Alt+Print` | Screenshot: focused monitor to disk |
|
||||||
|
| `CTRL+Shift+2` | Screenshot: focused monitor to disk |
|
||||||
|
| `Ctrl+Print` | Screenshot: interactive (region/window/screen) |
|
||||||
|
| `CTRL+Shift+3` | Screenshot: interactive (region/window/screen) |
|
||||||
|
|
||||||
## Emergency Escape Key
|
## Emergency Escape Key
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
type: reference
|
type: reference
|
||||||
title: Screenshot Matrix
|
title: Screenshot Matrix
|
||||||
description: Which screenshot binds work on blankpad as a function of output count — flameshot full is dead on 2+ outputs (niri D-Bus screencopy single-output limit, upstream niri#4313); Mod+Shift+S runs scripts/screenshot-desk.sh, the niri-native all-monitor capture.
|
description: Screenshot setup on blankpad — flameshot retired (all modes hang via portal on 2+ outputs, niri#4313); niri-native binds: all-monitors script, focused-screen capture, interactive UI. Includes the niri spawn-sh PATH trap.
|
||||||
tags:
|
tags:
|
||||||
- niri
|
- niri
|
||||||
- flameshot
|
- flameshot
|
||||||
@@ -13,73 +13,68 @@ verified: 2026-10-14
|
|||||||
|
|
||||||
# Screenshot Matrix
|
# Screenshot Matrix
|
||||||
|
|
||||||
Three capture stacks coexist on blankpad: **flameshot** (portal → niri
|
**Flameshot is retired on this box (2026-10-14).** Every flameshot mode
|
||||||
D-Bus screenshot API), niri's built-in **screenshot UI**, and
|
on Wayland captures through xdg-desktop-portal →
|
||||||
**scripts/screenshot-desk.sh** (drives niri per-output actions). The
|
`xdg-desktop-portal-gnome` → niri's GNOME-Screenshot compatibility API,
|
||||||
flameshot full-screen path breaks the moment the laptop docks to a
|
which is hard-limited to one output. All binds are niri-native now.
|
||||||
second output.
|
|
||||||
|
|
||||||
## Bind matrix by output count
|
## Live binds
|
||||||
|
|
||||||
| Bind | Tool | 1 output (portable) | 2+ outputs (docked home) |
|
| Bind | Action | Output |
|
||||||
|------|------|---------------------|--------------------------|
|
|------|--------|--------|
|
||||||
| `Print` / `Ctrl+Shift+1` | `flameshot full` | ✅ | ❌ error bubbles |
|
| `Print` / `Ctrl+Shift+1` / `Mod+Shift+S` | `screenshot-desk.sh` — one PNG **per monitor** | `~/Pictures/Screenshots/Screenshot from … <connector>.png` |
|
||||||
| `Alt+Print` / `Ctrl+Shift+2` | `flameshot screen` (focused) | ✅ | ✅ single-output request |
|
| `Alt+Print` / `Ctrl+Shift+2` | `screenshot-screen` — focused monitor | same dir (niri `screenshot-path`) + clipboard |
|
||||||
| `Ctrl+Print` / `Ctrl+Shift+3` | `flameshot gui` (region) | ✅ | ✅ (watch scaling on mixed-res, [flameshot#4449](https://github.com/flameshot-org/flameshot/issues/4449)) |
|
| `Ctrl+Print` / `Ctrl+Shift+3` | `screenshot` UI — interactive region/window/screen, Space saves, Esc cancels | same dir + clipboard; single-output selection by design |
|
||||||
| `Mod+Shift+S` | `screenshot-desk.sh` — one PNG **per monitor** | ✅ | ✅ the docked full-desk path |
|
|
||||||
|
|
||||||
`Mod+Shift+S` used to open noctalia settings; noctalia settings moved to
|
Noctalia settings lives on `Mod+Shift+O` (moved off Mod+Shift+S).
|
||||||
**`Mod+Shift+O`**.
|
|
||||||
|
|
||||||
## Why `flameshot full` dies docked
|
## Why flameshot died (and not just `full`)
|
||||||
|
|
||||||
- Flameshot 14 full-screen capture → xdg-desktop-portal →
|
- Portal chain: flameshot 14 → `xdg-desktop-portal-gnome` → niri D-Bus
|
||||||
`xdg-desktop-portal-gnome` → niri's GNOME-Screenshot compatibility D-Bus
|
API → `screenshot_all_outputs` → `ensure!(outputs.len() == 1)`
|
||||||
service.
|
(FIXME upstream).
|
||||||
- That service calls `Niri::screenshot_all_outputs` (src/niri.rs), which
|
- `flameshot full` on 2 outputs: each press emits **3 refusals**
|
||||||
starts with `ensure!(outputs.len() == 1)` (FIXME: multi-scale/crop
|
(composited screen + per-output) — `WARN niri::niri: error taking a
|
||||||
unsupported). On a 2-output virtual screen the request is refused;
|
screenshot: Condition failed: outputs.len() == 1 (2 vs 1)` in
|
||||||
flameshot pops an error bubble after the portal round-trip — the
|
`journalctl --user -u niri`; bubbles arrive after the portal
|
||||||
"bunch of errors after a delay".
|
round-trip ("bunch of errors after a delay").
|
||||||
- Compositor-side fingerprint (`journalctl --user -u niri`):
|
- `flameshot screen` is NOT exempt: live test docked, 2026-10-14 —
|
||||||
`WARN niri::niri: error taking a screenshot: Condition failed: outputs.len() == 1 (2 vs 1)`
|
`flameshot full` and `flameshot screen` both hang ~15 s, exit 124
|
||||||
|
under timeout, **no file written**.
|
||||||
- Upstream: [niri#4313](https://github.com/niri-wm/niri/issues/4313)
|
- Upstream: [niri#4313](https://github.com/niri-wm/niri/issues/4313)
|
||||||
(identical stack: niri 26.04 + Flameshot 14 + portal-gnome; closed as
|
(closed duplicate, unfixed in 26.04/8ed0da4),
|
||||||
duplicate, unfixed in 26.04/8ed0da4).
|
[flameshot#4449](https://github.com/flameshot-org/flameshot/issues/4449).
|
||||||
|
- Portable desk (1 output): flameshot would work again — that is the
|
||||||
## Why not niri's built-in `screenshot` UI
|
portal's only supported shape.
|
||||||
|
|
||||||
niri 26.04's default `screenshot` action opens the interactive
|
|
||||||
screenshot UI, and its selection is single-output by design
|
|
||||||
("this implementation allows only single-output selections for now",
|
|
||||||
src/ui/screenshot_ui.rs). One press = one monitor.
|
|
||||||
|
|
||||||
## The all-monitor path: `scripts/screenshot-desk.sh`
|
## The all-monitor path: `scripts/screenshot-desk.sh`
|
||||||
|
|
||||||
- Bind: `Mod+Shift+S` in [[keybindings|keybindings.md]].
|
- Per active output (`niri msg --json outputs`): `focus-monitor` →
|
||||||
- Deploy form: symlink `~/.local/bin/screenshot-desk.sh` →
|
`screenshot-screen --path` (absolute) → restore prior focus.
|
||||||
`~/.omp/scripts/screenshot-desk.sh` (same convention as `desk.sh`).
|
- All niri-native; no grim, no portal. `SCREENSHOT_DIR` overrides the
|
||||||
- Algorithm: for each active output from `niri msg --json outputs`,
|
output dir.
|
||||||
`focus-monitor` → `screenshot-screen --path` (absolute, one PNG),
|
|
||||||
then restore the previously focused monitor. All niri-native, no
|
## The spawn-sh PATH trap (why "it works in the shell" lies)
|
||||||
grim, no portal.
|
|
||||||
- Files: `~/Pictures/Screenshots/Screenshot from
|
niri's environment `PATH` is the **system** path — `~/.local/bin` is
|
||||||
YYYY-MM-DD HH-MM-SS <connector>.png` (dir overridable via
|
**absent** (`tr '\0' '\n' < /proc/$(pidof niri | awk '{print $1}')/environ`).
|
||||||
`SCREENSHOT_DIR`). Also honors `screenshot-path` in misc.kdl for the
|
`spawn-sh "some-user-script"` fails silently. Rules:
|
||||||
UI/screenshot-screen default when no `--path` is passed.
|
|
||||||
- Verified 2026-10-14 docked: two valid PNGs (eDP-1, DP-2), focus
|
- Keybinds use **absolute** script paths
|
||||||
restored.
|
(`/home/blank/.omp/scripts/…`). Applies to `desk.sh` too — its bare
|
||||||
|
bind was dead for the same reason.
|
||||||
|
- A bare script name in a keybind is a bug on this box.
|
||||||
|
|
||||||
## Census commands
|
## Census commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
niri msg outputs # how many outputs live
|
niri msg outputs # how many outputs live
|
||||||
journalctl --user -u niri --since today | grep -i screenshot # portal-path failures
|
journalctl --user -u niri --since today | grep -i screenshot # WARN vs DEBUG saves
|
||||||
pgrep -a flameshot # daemon state
|
tr '\0' '\n' < /proc/$(pgrep -x niri | head -1)/environ | grep ^PATH # spawn-sh environment
|
||||||
```
|
```
|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
- [[displays|displays.md]] — desk profiles: 1 output portable vs 2 docked
|
- [[displays|displays.md]] — desk profiles: 1 output portable vs 2 docked
|
||||||
- [[keybindings|keybindings.md]] — generated cheat sheet (source of the binds)
|
- [[keybindings|keybindings.md]] — generated cheat sheet (source of the binds)
|
||||||
- [[noctalia-shell|noctalia-shell]] — shell settings moved to Mod+Shift+O
|
- [[noctalia-shell|noctalia-shell]] — shell settings on Mod+Shift+O
|
||||||
Reference in new issue
Block a user