The unexpected hurdles of KWin scripting
Recently, I've been setting up Linux on my main machine, defaulting to KDE as it feels like it requires the fewest changes to suit my workflow. Having relied on AHK for "quake mode" persistent apps for years, I knew I'd need similar functionality on Linux.
Kwin scripts seemed like an obvious choice, and I expected the code to be simpler than AHK thanks to the saner syntax of JavaScript. Unfortunately, it couldn't be so simple. I spent hours trying to get any console output to prove my script was loaded. The reason? The documentation failed to note that paths in the manifest are relative to a mandatory contents directory, and, critically, there was no log indication that the file itself wasn't found.
Once that hurdle was cleared, the next challenge was figuring out why keyboard shortcuts weren't working. The answer was also "simple": the required defaultKeyBinding argument of the registerShortcut function is entirely ignored. Consequently, every action I create has no default bindings, forcing me to manually assign one in System Settings. That's fine, sure; but don't require me to provide a default binding if it's going to be ignored!