Global shortcuts
Custom OS-wide media keybinds in Settings
YTMDesktop2 can register global shortcuts so media controls work even when another app is focused.
Defaults:
- Previous track:
Shift+Alt+Left - Next track:
Shift+Alt+Right - Play / pause:
Shift+Alt+Space
Extra actions (play, pause, seek 10s, volume, like, dislike, shuffle, repeat) are listed in settings and stay unbound until you set them.
Setup
- Open Settings > Player > Shortcuts.
- Leave Enable global shortcuts on (off unregisters every bind).
- Click a bind, then press a combo. Escape cancels. Backspace or Delete clears.
- Use Reset on a row to restore that action's default, or Reset all (with confirm) to restore the three defaults and unbind the rest.
Safety
Binds are checked in the main process before they are saved:
- Must include Ctrl, Alt, or Cmd (Shift alone is rejected so typing is not stolen).
- OS-reserved combos (for example
Alt+F4,Alt+Tab,Win+L,Cmd+Q) are blocked. - Media/volume keys stay with the system media session.
- Duplicates across actions are rejected.
- Electron also probes
globalShortcut.register. If the OS or another app already owns the combo, the change is refused.
While you are capturing a bind, registered shortcuts are temporarily unregistered so the old combo does not fire.
Linux (Wayland)
On GNOME Wayland, Electron uses the XDG GlobalShortcuts portal. GNOME only accepts a reverse-DNS app id. YTMDesktop2 ships as net.venipa.ytmdesktop (same as the builder appId) and enables GlobalShortcutsPortal so you should get the GNOME approval dialog instead of a silent discard of ytmdesktop2.
If a bind still fails (portal denied, or an older install), turn Enable global shortcuts off and use MPRIS with playerctl from GNOME Keyboard custom shortcuts, for example playerctl -p ytmdesktop2 play-pause. See issue #266.