GTK Library and CLI tool for monitoring the Niri socket. Built to be used with gtk tooling such as AGS and gnim
To get started read the wiki
- install dependencies
sudo pacman -Syu meson vala json-glib gobject-introspectionsudo dnf install meson gcc valac json-glib-devel gobject-introspection-develsudo apt install meson valac libjson-glib-dev gobject-introspection- clone repo
git clone https://github.com/sameoldlab/niri-gtk
cd src- install
meson setup build
meson install -C buildMost distros recommend manual installs in /usr/local,
which is what meson defaults to. If you want to install to /usr
instead which most package managers do, set the prefix option:
meson setup --prefix /usr buildSetup is the same Astal libraries, using it will look something like this (with differences based on language):
Get outputs, workspaces, and windows from the default object as arrays:
// psuedocode
import Niri from "AstalNiri"
niri = Niri.get_default()
// Loop through
niri.windows.each(w => { // do stuff })
niri.workspaces.each(w => { // do stuff })
niri.outputs.each(o => { // do stuff })or iterating by layer:
for o in niri.outputs {
for ws in o.workspaces {
for win in ws.windows {
print("window ", win.name, " on output ", ws.idx, " from output ", o.name)
}
}
}// psuedocode
import Niri from "AstalNiri"
// All actions are available through Niri.msg
Niri.msg.focus_workspace_by_name("media")
// Some object specific actions can also be called through the object
niri = Niri.get_default()
mediaWs = niri.get_workspace(3)
mediaWs.focus()GTK Signals have the same names as Niri IPC events.