nirius

Crates.ionirius
lib.rsnirius
version0.4.3
created_at2025-05-08 08:29:57.868356+00
updated_at2025-09-09 15:55:51.879829+00
descriptionUtility commands for the niri wayland compositor
homepagehttps://sr.ht/~tsdh/nirius/
repositoryhttps://git.sr.ht/~tsdh/nirius
max_upload_size
id1665033
size84,668
Tassilo Horn (tsdh)

documentation

README

Nirius: utility commands for the niri wayland compositor

builds.sr.ht status License GPL 3 or later dependency status Hits-of-Code

Some utility commands for the niri wayland compositor. You have to start the niriusd daemon and then issue commands using the nirius utility. The daemon is best started by adding spawn-at-startup "niriusd" to niri's config.kdl.

Commands

  • focus [OPTIONS]: Focuses a matching window if there is one, otherwise exits non-zero. What windows match is specified using the options --app-id (-a) and --title (-t), both regular expressions. If there are multiple matching windows, the command cycles through them.
  • focus-or-spawn [OPTIONS] [COMMAND]...: Same behavior as focus except that it spawns COMMAND instead of exiting non-zero if no matching window exists.
  • toggle-mark [MARK]: Marks or unmarks a window with the given or default mark (which is __default__). Marked windows can be focused using focus-marked.
  • focus-marked [MARK]: Focuses the window marked with MARK, or the default mark __default__ if not given. If there are multiple such windows, cycles through all of them.
  • list-marked [MARK]: Lists all windows marked with MARK, or the default mark if not given, on stdout. If the --all flag is given, list all windows of all marks.
  • nop: Does nothing except having the side-effect of clearing the list of already visited windows captured during a sequence of focus, focus-or-spawn, or focus-marked commands.
  • move-to-current-workspace [OPTIONS]: Moves a matching window from some unfocused workspace to the currently focused workspace. If the --focus flag is given, the moved window also gains focus. If there is no matching window, exits non-zero.
  • move-to-current-workspace-or-spawn [OPTIONS] [COMMAND]: Same behavior as move-to-current-workspace except that it spawns the given COMMAND if there is no matching window.
  • toggle-follow-mode: Enables or disables follow mode for the currently focused window. When switching to another workspace, all windows in follow mode are moved to that workspace. (The main use-case for follow mode are floating video player windows, e.g., firefox Picture-in-Picture windows.)

Installation

Some distros have packaged nirius so that you can install it using your distro's package manager. Alternatively, it's easy to build and install it yourself using cargo.

Distro packages

The following GNU/Linux and BSD distros package nirius. Thanks a lot to the respective package maintainers! Refer to the repology site for details.

Packaging status

Building with cargo

You'll need to install the current stable rust toolchain using the one-liner shown at the official rust installation page.

Then you can install nirius like so:

cargo install nirius

For getting updates easily, I recommend the cargo cargo-update plugin.

# Install it once.
cargo install cargo-update

# Then you can update all installed rust binary crates including nirius using:
cargo install-update --all

# If you only want to update nirius, you can do so using:
cargo install-update -- nirius

Questions & Patches

For asking questions, sending feedback, or patches, refer to my public inbox (mailinglist). Please mention the project you are referring to in the subject, e.g., nirius (or other projects in different repositories).

Bugs

It compiles, therefore there are no bugs. Oh well, if you still found one or want to request a feature, you can do so here.

Build status

builds.sr.ht status

License

Nirius is licensed under the GPLv3 (or later).

Commit count: 0

cargo fmt