Dynamically assign windows as scratchpads against a numerical register.

niri-scratchpad ( as of version 1.0 ) is a running process that lives in memory.
spawn-sh-at-startup "niri-scratchpad daemon"You will need a static workspace called stash declared somewhere in you niri config. This will be where all stashed scratchpads live.
workspace "stash" {
open-on-output "DP-1" // Your output name, or just omit this property entirely
}For binding to a keybind you would do:
binds {
Mod+Q { spawn "niri-scratchpad" "create" "1"; }
}- This will take the currently focused window and bind it to niri-scratchpad register 1.
- Pressing this keybind again will toggle stashing and unstashing the window when this command is reran.
A separate command is available for removing a scratchpad at a particular register.
binds {
Mod+Ctrl+Q { spawn "niri-scratchpad" "delete" "1"; }
}- Delete scratchpad at register 1
- This register will now be available again for the
niri-scratchpad create 1command
niri-scratchpad daemonStart the niri-scratchpad daemon ( I advise to have niri run this command on startup )niri-scratchpad create <scratchpad_number>- Info: create OR summon a scratchpad window at
<scratchpad_number> - options
-o, --output [title, appid]--as-float
- Info: create OR summon a scratchpad window at
niri-scratchpad delete <scratchpad_number>- Info: delete a scratchpad at
<scratchpad_number>.
this deleted scratchpad will have its window summoned to curent workspace - options
-o, --output [title, appid]
- Info: delete a scratchpad at
niri-scratchpad get <scratchpad_number> [title, appid]help
--output provides the property to standard out after command execution.
--as-float during new scratchpad registration to a window, also put that window into floating mode.
It's just a rust binary:
for x86_64 I provide the executable directly. Download it, put it somewhere at chmod +x niri-scratchpad. Then run it with the options to use it.
Dependencies:
rustcargoniri_ipcserdeclap
inputs {
niri-scratchpad.url = "github:argosnothing/niri-scratchpad";
}To put it in your path on nix:
environment.systemPackages = [
inputs.niri-scratchpad.packages.${pkgs.system}.default
];- Static scratchpads you can bind with a spawn command gvolpe
- niri scratchpad discussion