Gnome Wayland support
I tried to build the app for fedora myself, but it keeps crashing and I don't have enough rust knowledge to debug.
This is the error I am getting.
thread 'main' panicked at /home/runner/.cargo/git/checkouts/exwlshelleventloop-a014b6ad85076b09/de88e8d/layershellev/src/lib.rs:2472:34:
called \Result::unwrap()` on an `Err` value: NotPresent`
note: run with \RUST_BACKTRACE=1` environment variable to display a backtrace`
thread '<unnamed>' panicked at /home/runner/work/gauntlet/gauntlet/rust/utils/src/channel.rs:100:14:
the other side of a channel was dropped
2025-01-28T01:18:43.009951Z ERROR gauntlet_plugin_runtime: Unable to handle message: unexpected end of file
2025-01-28T01:18:43.009985Z ERROR gauntlet_plugin_runtime: Message loop has returned an error: unexpected end of file
2025-01-28T01:18:43.009998Z ERROR gauntlet_plugin_runtime: Message loop has unexpectedly stopped PluginId("bundled://gauntlet")
thread 'main' panicked at rust/plugin_runtime/src/lib.rs:57:10:
plugin runtime crashed: Broken pipe (os error 32)
note: run with \RUST_BACKTRACE=1` environment variable to display a backtrace`
Rejected promise, reason: Error: event stream was suddenly closed
at async runPluginLoop (ext:gauntlet/core.js:310:29)
at async gauntlet:init:8:5
I assume you are running Wayland Gnome. It is currently not supported because Wayland Gnome is pretty much the only Wayland implementation that doesn't support Layer Shell protocol. I think Gnome Wayland also doesn't support global shortcuts.
It is also not possible to hide and show window on Wayland in general. This could be solved by recreating a window each time but Iced has a 100% usage bug atm if no windows are present: https://github.com/iced-rs/iced/issues/2719
It might be possible to support it by:
- Remove requirement for Layer Shell on Wayland and create a simple window
- Create custom Gnome plugin that will
- On global shortcut show the window
- Position window properly in the center and on top of everything (which is also not supported on wayland in general)
- And properly hide the window if previously mentioned bug is not fixed
But this is currently a low priority
I am running wayland yes, the global shortcut is not an issue if there's a command to show the window, since I can map the command to any shortcut I want anyway.
Theres now support for Global shortcuts in Wayland. Also Ulauncher has been using a cli tool to toggle the window. I'm not into Rust either but would like to see it on Fedora Gnome Wayland as well
I would absolutely love a cross-platform launcher. +1 on this. I am running gnome on wayland and there is the ability to set custom shortcuts, i am assuming it is running a command for ulauncher:
Settings this up i wouldn't mind, but last time i tried, i cannot even run the app on arch.
Gauntlet v20 with Gnome Wayland support is released. The layer shell requirement was removed and normal window is created each time instead. There may be some issues with ordering or positioning of the window, but application has no control over that and it is fully dependent on Gnome.
There is also no Global Shortcuts support on Gnome Wayland.
<rant> Global Shortcuts Portal is an unusable mess right now. I could only find 3 implementation: Gnome, KDE and Hyprland. The spec barely says anything about behavior of methods, so all 3 implement it in a different way, and it is impossible to understand now it is supposed to be used from application side. Calling bind_shortcuts can open a dialog. Gnome seems to expect that bind_shortcuts will only be called once per session. KDE, looking at code, seems to expect that it is called multiple times, but dialog UI is very confusing because it seems to remove all shortcuts not in new_shortcuts parameter. Hyprland seems to expect that it can be called multiple times, and does never unregister shortcuts. Gauntlet's list of global shortcuts also depends on list of plugins, and user would usually use only a couple of shortcuts, so depending on implementation we would create hundreds of shortcuts or have dangling shortcuts for removed plugins. It is not clear when exactly bind_shortcuts is supposed to be called, is it when application starts (doesn't work for daemon apps like gauntlet), is it from button in settings ui that can be pressed once (there is argument to be made about terrible UX here), or is it separately for each shortcut? I have no idea what is the expected way to use this even in normal app which is not a daemon and has a static list of shortcuts. It is also widely different from same apis on x11, windows and macos, and having cross platform api seems impossible without creating horrific UX
Unless there are big changes to the portal I will not be implementing it, and would recommend other wayland app developers to do the same. I think the existence of this portal will hurt Linux more than help </rant>
As an alternative please use CLI command and register it in Gnome settings as custom shortcut. Ulauncher does exactly this but by manipulating settings via CLI commands automatically, which I am not willing to do, but I will accept the documentation PRs I anybody wants to describe the setup
Closing this issue, if there are any problems with Gnome support please open a new one
THANK YOU!