chore: update README.md

This commit is contained in:
atagen 2025-06-23 20:28:59 +10:00
parent 89871af5c4
commit 5b631a1af0

View File

@ -10,12 +10,13 @@ tag based management is relatively intuitive - sets of windows are assigned nume
these tags are then de/activated to raise and lower the windows. \
only a single workspace is ever in active use per output.
## usage
# usage
### typical unix
## typical unix
first,\
clone the repo.\
clone a niri source tree into a subdirectory called niri - make sure it is the same release you are running.\
build and install with cargo as per usual for rust projects on your platform.
next,\
@ -43,7 +44,7 @@ niri's `exec-once` *should* also be okay, but the use of a service manager is hi
finally,\
set up niri binds using `tagctl` to control windows and tags as you see fit.
### nixos (flakes)
## nixos (flakes)
first,\
add the following to your flake inputs:
@ -73,7 +74,7 @@ in
...
````
### bindings
## bindings
first,\
it is recommended that you unset all workspace related binds, as
@ -94,5 +95,72 @@ all commands (except `remove`) take a tag number from 1-255 after their command.
finally,\
you may now use the aforementioned binds to assign tags to windows and toggle the tags on and off to hide/reveal them.
enjoy !
## config
configs are expected to be located at `$XDG_CONFIG_DIR/niri-tag/config.toml`.\
they are simple, headerless toml files.
the current config options (and their defaults) are:
````toml
# prepopulates a certain number of tags, from 1-255.
# this is useful for getting the full number of tags you intend to use
# premade and sent in any initial event stream connection.
prepopulate = 3
# strict workspaces
# this prevents you from switching away from the workspaces that were on each monitor
# when niri-tag was started, ensuring you don't accidentally break the window management
# paradigm, or get your desktop stuck in a weird state.
strict = true
````
## ipc
### command socket
`tagctl` is a simple wrapper over a one-shot socket connection to the niri-tag ipc, a socket which should be available at `$XDG_RUNTIME_DIR/niri-tag.sock`.\
this socket accepts all the `tagctl` commands, as formatted in PascalCase rather than kebab-case, and sent as a single JSON object per connection (for now) followed by a line ending.
as an example,
````json
{"EnableTag":4}
````
### event stream socket
there is a stream of events available via `$XDG_RUNTIME_DIR/niri-tag-events.sock`.
on initial connection, you will be sent your first and only `TagFullState` event, a JSON object summarising the entire state of the tag system, sent in similar fashion to the command socket.
following that, a stream of tag events with one JSON object per line will be sent for every niri-tag operation, until you close the connection.
#### events
here is a summary of possible events:
````json
{"TagEmpty": int} // tag no longer contains any windows
{"TagOccupied": int} // tag now contains window/s
{"TagUrgent": int} // tag has window signaling urgency
{"TagEnabled": int} // tag now enabled
{"TagDisabled": int} // tag now disabled
{"TagExclusive": int} // tag has been enabled to exclusion of all others
{"TagFullState": {
"1": {
"enabled": bool,
"occupied": bool,
"urgent": bool
},
... // more tags detailed in similar fashion
}
} // a full account of the tag state, sent only once on connection
````
## acknowledgements
- YaLTeR - for creating niri and blessing it with excellent IPC
- sodiboo - for niri-flake
- outfoxxed - for advice on XDG, IPC, and other TLA
- me - for writing this excellent program
enjoy !