oliverschwendener / ueli

Cross-Platform Keystroke Launcher
https://ueli.app
MIT License
3.66k stars 242 forks source link

[Bug] Global shortcut does not work on Linux using Wayland #1170

Open ke1v opened 3 months ago

ke1v commented 3 months ago

Describe the bug Global hotkeys are not available on Linux under GNOME Wayland sessions.

To Reproduce Steps to reproduce the behavior:

  1. Launch ueli on GNOME Wayland
  2. Hide ueli window
  3. Press hotkey
  4. Ueli does not reappear

Expected behavior Ueli should reappear when using the global hotkey

Environment

Additional context This appears to be an upstream bug (https://github.com/electron/electron/issues/38288) in Electron, as Wayland does not provide a way for Electron to register global hotkeys.

ke1v commented 3 months ago

I'm proposing a workaround that seems to be popular with other apps, where calling the executable with an argument flag (ie. ueli --toggle) will dispatch the same event in the main process (using Electron's requestSingleInstanceLock) as pressing the global hotkey. If anyone has a better idea please feel free to suggest them.

Neitex commented 2 months ago

+1 to the proposal above. This solution would also enable ueli's usage outside of full desktop environments. For instance, setting XDG_SESSION_DESKTOP=gnome makes application search extension work smoothly even with Hyprland Wayland compositor (tested on ueli commit 737655b). So this workaround would make ueli a decent alternative to, for example, ULauncher across various Linux setups, not just within major desktop environments.

ke1v commented 1 month ago

This solution would also enable ueli's usage outside of full desktop environments.

I'm curious as to what you mean by this?

setting XDG_SESSION_DESKTOP=gnome makes application search extension work

BTW this should be fixed in 9.3.5 (although Hyprland may not have working icon support)

Neitex commented 1 month ago

I'm curious as to what you mean by this?

I mean the fact that if we can have a CLI switch like this, it could also render ueli fully usable in bare window managers like Hyprland, sway etc. without needing full-blown GNOME, KDE etc.

BTW this should be fixed in 9.3.5 (although Hyprland may not have working icon support)

Thanks, I'll be sure to check it out!