Wayland: show compositor keybinding instructions instead of shortcut picker
Context
From Discussion #44 with @Dieterbe. On Wayland, apps cannot register global hotkeys. The compositor owns global keybindings. The current settings dialog shows a keyboard shortcut picker that won't work on Wayland.
What needs to happen
- Detect Wayland at runtime (check
WAYLAND_DISPLAYorXDG_SESSION_TYPEenv vars) - Replace shortcut picker on Wayland with instructions:
- Show that
minutes toggle-recordingandminutes toggle-dictationCLI commands exist - Link to documentation for binding these in common compositors (Hyprland
bind, GNOME Settings, KDE Shortcuts)
- Show that
- Keep the shortcut picker on macOS and X11 where global hotkeys work natively
Example compositor config
# Hyprland example
bind = SUPER, R, exec, minutes toggle-recording
bind = SUPER, D, exec, minutes toggle-dictation
Relevant code
crates/core/src/hotkey_macos.rs- macOS-specific CGEventTap implementation- Tauri settings dialog UI
Related: Discussion #44
Note that most/proper wayland compositors allow forwarding "approved" keybinds to specific applications. Hyprland is probably the most common one, see its docs here https://wiki.hypr.land/Configuring/Binds/#global-keybinds
so doing the keybinding only at the compositor level (by having it invoke CLI commands) may be the most simple/robust/universal way to do it, but you don't need to do it that way: you can also have the compositor pass them through to minutes, and then setup minutes to recognize them as usual. This does mean the user needs to maintain 2 pairs of keybinds: the same config but in two different places, and not all compositors implement this. Arguably this is "cleaner" but I think the CLI invocation idea is better.
@Dieterbe good call on CLI invocation being the better path. Maintaining the same keybind in two places (compositor + app) is the kind of thing that works in a demo and breaks in real life.
The scope here is:
- Detect Wayland at runtime (
WAYLAND_DISPLAY/XDG_SESSION_TYPE) - Swap the shortcut picker for a panel that shows the CLI commands and example compositor configs (Hyprland
bind, GNOME, KDE) - Leave macOS and X11 behavior untouched
Keeping this tagged as a good first issue. The detection is straightforward and the UI swap is self-contained. Happy to help anyone who wants to pick it up.