minutes icon indicating copy to clipboard operation
minutes copied to clipboard

Wayland: show compositor keybinding instructions instead of shortcut picker

Open silverstein opened this issue 8 months ago • 2 comments

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

  1. Detect Wayland at runtime (check WAYLAND_DISPLAY or XDG_SESSION_TYPE env vars)
  2. Replace shortcut picker on Wayland with instructions:
    • Show that minutes toggle-recording and minutes toggle-dictation CLI commands exist
    • Link to documentation for binding these in common compositors (Hyprland bind, GNOME Settings, KDE Shortcuts)
  3. 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

silverstein avatar Apr 02 '26 14:04 silverstein

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 avatar Apr 02 '26 17:04 Dieterbe

@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:

  1. Detect Wayland at runtime (WAYLAND_DISPLAY / XDG_SESSION_TYPE)
  2. Swap the shortcut picker for a panel that shows the CLI commands and example compositor configs (Hyprland bind, GNOME, KDE)
  3. 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.

silverstein avatar Apr 03 '26 14:04 silverstein