Skip to content

sameoldlab/niri-gtk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

925 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Niri GTK

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

Installation

  1. install dependencies
sudo pacman -Syu meson vala json-glib gobject-introspection
sudo dnf install meson gcc valac json-glib-devel gobject-introspection-devel
sudo apt install meson valac libjson-glib-dev gobject-introspection
  1. clone repo
git clone https://github.com/sameoldlab/niri-gtk
cd src
  1. install
meson setup build
meson install -C build

Most 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 build

Usage

Setup is the same Astal libraries, using it will look something like this (with differences based on language):

Get Data

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)
    }
  }
}

Send Actions

// 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.

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors