Configuration reloading in KWin QML scripts

How can a QML KWin script listen for changes to its configuration?

I tried using org.kde.kwin.Options, either procedurally or declaratively:

Connections {
    target: Options

    function onConfigChanged() {
        console.log("Configuration was changed");
    }
}

But it never fires. I noticed that I’m not the only person having this issue, since kzones also seems to be stumped.

I am able to read the config on demand using KWin.readConfig("key", defaultValue), which I do at startup, but I’d like to be able to react to changes to the configuration too.

1 Like