I'm using a KDE+i3 setup on my machine and therefore I want to disable all the global hotkeys provided by KDE, since I've binded the keys properly in my i3-config.
Upon exploring qdbus API, I've found out the command works per Plasma session:

qdbus org.kde.kglobalaccel /kglobalaccel blockGlobalShortcuts true


The issue is how to begin with its automation. The following are the issues:

  • Global keys start working again after Sleep, Lock etc. which restart Plasma.
  • I've used
    exec --no-startup-id qdbus org.kde.kglobalaccel /kglobalaccel \
    blockGlobalShortcuts true
    for now but only works till Plasma doesn't restart.

How should I proceed with implementing this?

  • Also, it would be better if the solution would be implemented by i3wm since I'm planning to keep my Plasma Xsession untouched. – Utkarsh Verma Mar 29 at 2:20

I've found a way to disable all the global shortcuts of KDE. Here's what I did:

  • The hotkeys are saved in ~/.config/kglobalshortcutsrc in the form of foo=bar assignments.
  • Using sed, replace the hotkeys.
  • Restart kglobalaccel to observe the changes.

Here's the script:



# Remove application launching shortcuts.
sed -i 's/_launch=[^,]*/_launch=none/g' $hotkeysRC

# Remove other global shortcuts.
sed -i 's/^\([^_].*\)=[^,]*/\1=none/g' $hotkeysRC

# Reload hotkeys.
kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &

Now I can finally move all of my key bindings to i3 config!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.