Skip to content

vncsmyrnk/gwin

Repository files navigation

GNOME Zig AUR Version APT Version
CI/CD workflow contributions

gwin

A "Run or raise" CLI tool for Wayland GNOME, leveraging the window-calls extension D-Bus interface for opened windows.

Context

GNOME's Wayland implementation does not support native ways to securely access window lists due to security risks. If you want to use a custom dmenu tool or have special bindings for switching between opened windows, the only solution to achieve this until now is using Mutter to fetch the windows state via an extension.

Fortunately, this extension already exists: window-calls extension. It also export this state over D-Bus, making it possible to view and manipulate it.

Goal

This project aims to provide ways to open currently opened instances or launch new ones when there is no instance already opened. GNOME's default finder already achieves this but offers minimal customization and GNOME itself does not offer native ways to use external dmenus like rofi.

The primary goal is to provide useful, predefined and optimized use cases for switching between opened windows via window-calls and its D-Bus interface, avoiding the overhead of connections and fragile parsing when using multi-purpose D-Bus tools like bustcl.

Secondary goals

  • Provide a list of opened windows and ways to switch to them via dmenus
  • Provide a list of installed applications and ways to run or raise them via dmenus

Note

Why Zig? It can directly import C bindings for GDBus, already included as part of GNOME project's GLib (gio/gdbus).

Examples

Switching to opening windows using rofi

gwin list windows --rofi | rofi -x11 -normal-window -dmenu | xargs -I{} gwin switch --id {}

Running or raising applications using rofi

gwin list applications --rofi | rofi -x11 -normal-window -dmenu | xargs -I{} gwin raise {}

Install

AUR

Install it with your favorite AUR helper.

yay -S gwin-git

APT (Debian and its derivatives)

echo "deb [trusted=yes] https://apt.fury.io/vncsmyrnk /" | sudo tee /etc/apt/sources.list.d/fury.list
sudo apt update && sudo apt install gwin

From source

git clone git@github.com:vncsmyrnk/gwin.git
just build
./zig-out/bin/gwin

Important

Make sure to have the window-calls extension installed before running gwin. Restart the GNOME session after installing the extension.

Roadmap and new features

Check out issues for upcoming changes or bug fixes.

About

A "Run or raise" CLI tool for Wayland GNOME.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Contributors