oliverschwendener / ueli

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

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

Open ke1v opened 3 weeks ago

ke1v commented 3 weeks 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 weeks 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 weeks 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.