跳到正文
DEV Community· Stephen Metcalfe·· 2 小時前AI 評分41

回歸 KDE 後,我終於打造了心目中的快捷鍵工具

Coming back to KDE, I finally built the shortcut tool I’d always wanted

AI 導讀

作者打造 Plasma Shortcut Explorer,讓 KDE Plasma 用戶以可搜尋的浮層查找已設定的全域快捷鍵。工具支援按動作名稱、應用程式或按鍵組合搜尋,並讀取 KGlobalAccel 中包括自訂項目在內的快捷鍵;它只供查閲,不會執行動作或更改設定。此工具以 Python 和 PySide6 編寫,採用 MIT 授權。

正文

I recently came back to KDE Plasma after spending some time with Omarchy. While getting my desktop set up again, I ran into a familiar problem: remembering which keyboard shortcuts did what.

Some I remember without thinking. Others I change and then promptly forget. And there are actions I’d probably use if I remembered they had a shortcut in the first place. I wanted to press a key, search for an action, see its shortcut, and carry on with whatever I was doing.

Thinking about it, this had always been missing from my setup. Coming back to KDE was just what finally got me to do something about it.

So I built Plasma Shortcut Explorer..

It’s a small application that reads the global shortcuts configured in your Plasma session and puts them in a searchable overlay. You can look up an action by name, search for an application, or enter a key combination.

It reads your assigned bindings from KDE’s KGlobalAccel service, including the ones you’ve customised. That matters when your desktop has gradually drifted away from the defaults.

You choose a shortcut to open the explorer through Plasma’s settings. Open it, type a few words, find what you need, and press Escape to close it. If a binding needs changing, there’s a button to open the relevant application’s shortcut settings.

The explorer is read-only. Clicking a result won’t run the action or change its binding. It covers global shortcuts registered with KGlobalAccel, so you won’t find every shortcut from every application menu in there.

There was also more work around the little search window than the initial idea suggested. Shortcut discovery needed a timeout and a way to preserve partial results. The uninstaller needed to be careful about what it removed. Tests that imitate KDE’s shortcut service needed their own private D-Bus session, safely away from the real one.

It’s still a young project. I’ve been testing it on Plasma under Wayland, and I’d like to hear how it behaves on other people’s desktops.

It’s written in Python with PySide6, and the source is available under the MIT licence.

The repository has screenshots and installation instructions, along with release downloads.

I used AI to help build it, and as a software developer with nearly 30 years of writing code behind me, I’m happy to say so. I don’t have much patience for dismissing something purely because AI was involved. If there’s a bug, tell me about it. If I’ve misunderstood a KDE API or made an awkward interface choice, I’d like to hear that too. There’s code to look at and an app to try, so we can have a fairly concrete discussion. Using AI doesn’t hand responsibility for the result to someone else. I’m the one publishing it. 😅

If you give it a go, let me know what you find. I’m particularly interested in shortcuts you expect to see that don’t show up, or anything that makes looking one up more effort than it should be.

Stephen / Raithlin

來源:DEV Community · dev.to