Allow KRunner To Permanently Use Super/Meta Key Only As Shortcut - Currently Removes Custom Shortcut On Reboot

Currently behavior: When I set a custom shortcut for KRunner to open when using only Super/Meta key alone it works fine until a reboot. Upon reboot that custom shortcut is removed without notice.
No warnings, no errors, just my shortcut gone.
The reason I am doing this is that I have decided to only use KRunner instead of any Application Launcher/Dashboard and want the keyboard experience to be seamless. I have removed all App launchers/dashboards from all of my panels, and don’t have any on my desktop.
What is currently happening is a horrible user experience. To set something up and just have it be gone with no trace.
My process:

  1. Remove all App Launchers/Dashboards from all panels and desktop
  2. System Settings>Shortcuts>Shortcuts>KRunner>KRunner Dropdown
  3. Add custom Shortcut
  4. Press Super
  5. Apply

Currently using:
Operating System: Manjaro Linux
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Kernel Version: 6.5.1-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 16 × Intel® Core™ i7-10700F CPU @ 2.90GHz
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2
Manufacturer: ASUS

I verified this behavior in the current user version of KDE Neon as well. Same thing happens.

Desired behavior options:

  1. Have an option to change or add Meta/Super alone to open KRunner.
    or
  2. Just don’t delete my custom shortcut for KRunner.

You can see my original post on this topic in the Manjaro Forums: Custom Shortcut for KRunner Disappears Every Reboot - KDE Plasma - Manjaro Linux Forum

by making the hot key just meta by itself don’t you prevent all the the other meta+__ hotkeys from working?

asking for a friend, because i just use a mouse.

Not from my experience thus far. From what I understand the key press behavior isn’t determined until after the keys are lifted so Meta+“other key” is not the same as just Meta. Just as when the key is tied to the Application Launcher it doesn’t prevent the usage of Meta+“other key” shortcuts.

Oh wait, I was just given this page. Looking over it now.
https://userbase.kde.org/Plasma/Tips#open-krunner-with-windows-meta-key

This does appear to be my solution.
There should be some sort of way still to redirect someone to the proper way to do it or tell them that they are doing it wrong instead of just mysteriously disappearing upon reboot.

Turns out that it was not the solution for me, because it didn’t work!
Ran the command. No response, but it didn’t give an error so I thought that was a good sign. Rebooted later and tested to find that nope, my “Windows”/Super/Meta doesn’t open KRunner at all. Tried running the command again. Tried as well as sudo, but experienced no change.

instructions unclear:

looking at the indicated rc file and reading the text of that “tip” several times in the context of the the other tips, and in addition to knowing fuckall about what i’m looking at, i would have to try and add a whole new section to the rc file that looks exactly like this (plasma 5.24)

[ModifierOnlyShortcuts]
kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Meta "org.kde.kglobalaccel,/component/krunner_desktop,org.kde.kglobalaccel.Component,invokeShortcut,_launch"
qdbus org.kde.KWin /KWin reconfigure

then i would need to logout and log back in again to see the changes.

is that what you did?

“looking at the indicated rc file and reading the text of that “tip” several times in the context of the the other tips, and in addition to knowing fuckall about what i’m looking at, …” :rofl: so funny

How Plasma handles the Meta key is kinda special, so instead of going to kglobalshortcutsrc it goes to kwinrc instead.

FWIW I did this at some point, a small Kdialog window that shows up asking if you want to enable/disable using Meta to open KRunner. Internally it’s just the snippets of code you already used there. For it to work you need to know if your distro provides qdbus or qdbus-qt5 or qdbus6.

I need to check if it still works (it probably does).

2 Likes

I copied the 2 lines of the action in that file and ran it. Looks good!
Rebooted…
Success! It has held!
Your command is a little bit different than the one in documentation, but something in that difference is what made it work for me.

Also @skyfishgoo I didn’t really look at your block, but your statement above it is hilariously worded. To answer your question, I did not log out and back in, but did trigger a computer restart. To my understanding though, the command in documentation would not require logging out and back in as just kwin needs to be restarted per documentation. The 2nd line of the command restarts kwin with the new configuration.

To wrap up this thread now I would like to reiterate my request for a more graceful experience for users on this.
Desired behavior options:

  1. Have an option to change or add Meta/Super alone to open KRunner.
    or
  2. Just don’t delete my custom shortcut for KRunner out of nowhere.

Thank you for this script, it was the only thing that worked for me!

Even though it’s now possible to specify the meta key in System Settings - Shortcuts, it didn’t work for me.

(Plasma 6.0.1, Tumbleweed)

I’m sure I remember @ngraham talking about improvements to the whole modifier-only-shortcuts at various points over the past few years (either in his blog or on Reddit), but can’t find those posts now to see what the status of that work was, whether it was meant to now be finished or not.

I actually just installed OpenSuse Tumbleweed the day before yesterday which was still on KDE5, but then yesterday upgraded to KDE6. The script didn’t fully work for me anymore. The first part with:

kwriteconfig5 --file kwinrc --group ModifierOnlyShortcuts --key Meta "org.kde.krunner,/App,,toggleDisplay"

I believe worked, but the second part:

qdbus org.kde.KWin /KWin reconfigure

failed and did not restart KWin. But upon restarting my session later it works.

Side note, had a bunch of headaches with OpenSuse Tumbleweed so far and now that I have a dedicated /home SSD I’m probably going to hop again. Probably going to go to Gentoo.

@Nerdgasm, as @Herzenschein said:

On Tumbleweed with Plasma 6 you have qdbus6 so you need to swap out qdbus for qdbus6 in the two places in the script.