A "Run or raise" CLI tool for Wayland GNOME, leveraging the window-calls extension D-Bus interface for opened windows.
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.
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.
- 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).
gwin list windows --rofi | rofi -x11 -normal-window -dmenu | xargs -I{} gwin switch --id {}gwin list applications --rofi | rofi -x11 -normal-window -dmenu | xargs -I{} gwin raise {}Install it with your favorite AUR helper.
yay -S gwin-gitecho "deb [trusted=yes] https://apt.fury.io/vncsmyrnk /" | sudo tee /etc/apt/sources.list.d/fury.list
sudo apt update && sudo apt install gwingit clone git@github.com:vncsmyrnk/gwin.git
just build
./zig-out/bin/gwinImportant
Make sure to have the window-calls extension installed before running gwin. Restart the GNOME session after installing the extension.
Check out issues for upcoming changes or bug fixes.