| name | keyboard-shortcuts |
| description | Inspect and audit KGlobalAccel keyboard shortcuts (global hotkeys) on KDE Plasma. Use when the user wants to see what a Meta/Ctrl/Alt combination is bound to, find a free combination, or troubleshoot a shortcut that stopped firing. Reads are reliable; writes on Plasma 6 Wayland are not — see the warning below before offering to bind anything. |
KGlobalAccel Shortcuts
Plasma global shortcuts live in ~/.config/kglobalshortcutsrc and are managed by
the kglobalaccel daemon.
Reading is reliable. Writing is not.
On Plasma 6 Wayland there is currently no verified way to bind a shortcut from
the command line and have it take effect in the running session. Do not tell the
user a binding is done after writing the config file — it very likely is not.
See Writing below.
Inspect
grep -E '^\[|^[A-Za-z]' ~/.config/kglobalshortcutsrc
kreadconfig6 --file kglobalshortcutsrc --group "krunner.desktop" --key "_launch"
qdbus6 org.kde.kglobalaccel /kglobalaccel org.kde.KGlobalAccel.allMainComponents
File format
ShortcutName=<active>,<default>,<friendly name>
# e.g.
_launch=Alt+Space,Alt+Space,KRunner
<active> is what is bound now; <default> is what it ships as.
<active>=none means explicitly unbound.
- Multiple combinations are tab-separated within the field:
Meta+R\tAlt+F2.
- An empty
<active> with a non-empty <default> means "never customised".
Finding a free combination
To check whether a combination is already taken, grep the whole file for it rather
than reasoning about a single component — bindings are scattered across every
[component.desktop] group, and Plasma itself reserves a lot of Meta+*.
grep -n "Meta+Shift+K" ~/.config/kglobalshortcutsrc
Remember that this file only holds global shortcuts. Per-application accelerators
live in ~/.config/kdeglobals under [Shortcuts] and in per-app *shortcutsrc
files, and will not show up here.
Writing
Verified not to work on Plasma 6 Wayland (ThinkPad E15 Gen 3, Plasma 6):
-
kwriteconfig6 + D-Bus reload. The value is written to the file correctly,
but kglobalaccel does not reliably adopt it. In testing the binding only
became active after a full logout and login. Corroborated by
KDE Discuss #17995.
kwriteconfig6 --file kglobalshortcutsrc --group "krunner.desktop" \
--key "_launch" "Alt+Space,Alt+Space,KRunner"
qdbus6 org.kde.kglobalaccel /kglobalaccel org.kde.KGlobalAccel.reloadConfiguration
-
The khotkeys route. The khotkeys KDED module does not exist in Plasma 6.
qdbus org.kde.kded6 /modules/khotkeys reread_configuration has no target;
~/.config/khotkeysrc is a Plasma 5 artefact. Custom command shortcuts moved
into the Shortcuts KCM.
-
.desktop file with X-KDE-Shortcuts=. Does not register.
What to do instead
For custom command shortcuts, walk the user through the GUI — currently the
only reliable path:
- System Settings → Shortcuts
- + Add New → Command or Script
- Name it, set the command (use an absolute path)
- Add… next to "Custom shortcuts", press the key combination
- Apply
Then, if the result should be reproducible, commit the resulting
~/.config/kglobalshortcutsrc to a dotfiles or config repo — capture the outcome
rather than trying to script the input.
For rebinding an existing application shortcut, the same KCM has a per-app
search; that also applies immediately.
If the user explicitly accepts a logout, kwriteconfig6 plus a logout does work,
and is scriptable for machine setup where a logout is happening anyway. Say that
the logout is required rather than presenting it as optional.
Full write-up of what was tried and rejected:
custom-keybindings.
Troubleshooting a shortcut that stopped firing
- Confirm it is still in the file — a Plasma upgrade can reset
<active> to the
default.
- Check for a conflict: grep the combination across the whole file; the later
registrant may have stolen it silently.
- Confirm the daemon is alive:
pgrep -a kglobalaccel.
- On Wayland, Plasma owns the global keymap outright. X11-era tools (
xbindkeys,
xdotool bindings) do not work and are not a fallback.
- If the target is a
.desktop launcher, verify the launcher itself still
resolves — a broken Exec= presents as a dead shortcut.