Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dynamic Scratchpad Management for Niri

License

NotificationsYou must be signed in to change notification settings

argosnothing/niri-scratchpad-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamically assign windows as scratchpads against a numerical register.tmp XVc2CNDYYc

Setup

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 calledstash 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 theniri-scratchpad create 1 command

Command interface:

  • niri-scratchpad daemon Start the niri-scratchpad daemon ( I advise to have niri run this command on startup )
  • niri-scratchpad create <scratchpad_number>
    • Info: createOR summon a scratchpad window at<scratchpad_number>
    • options
      • -o, --output [title, appid]
      • --as-float
  • 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]
  • 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.

Installation

It's just a rust binary:
forx86_64 I provide the executable directly. Download it, put it somewhere atchmod +x niri-scratchpad. Then run it with the options to use it.

Building

Dependencies:

  • rust
  • cargo
  • niri_ipc
  • serde
  • clap

Nix (flakes)

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

Extra Resources for scratchpads in niri

Secret Bonus

I have anexperimental branch that uses adraft niri PR i've been working on.

I'm daily driving this as it gives me a full scratchpad implementation that hides the workspace where my stashed scratchpads live. This PR should also work with other implementations as long as you make sure you stashed workspace also hashidden true in it and you doniri msg workspaces-with-hidden instead of justniri msg workspaces. This implementation does not advertise hidden workspaces to event stream, and only updates state with hidden workspaces for that specific ipc action, so your bars and widgets that show workspaces will not show those hidden workspaces.

If you plan on using this please let me know if you run into any bugs, any feedback is welcome!

About

Dynamic Scratchpad Management for Niri

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp