Closed Akselmo closed 2 years ago
The problem should be fixed now; please reinstall, including running the fix described in the readme again, and see if it works now.
The settings menu now appeared, but the script is still not doing anything when i move the window around screen. Is there some way I can help you debug this?
I tried to run the script with qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.showInteractiveConsole
and it returns
Executing script at Monday, 18 October 2021 21:53:02 EEST
Runtime: 1ms
SyntaxError: Parse error
I enabled debug mode from kdebugsettings
and kwin_x11 --replace &
gave me this
kwin_scripting: defaultscript encountered an error at [Line 25 ]
kwin_scripting: Message: "SyntaxError: Parse error"
kwin_scripting: -----------------
kwin_scripting: "message" : "Parse error"
kwin_scripting: "lineNumber" : "25"
kwin_scripting: "sourceId" : "140203906767488"
kwin_scripting: "fileName" : ""
This also pops up when enabling the script from menu. Wonder what's going wrong with that part of code, since it works for you.
I figured it out! I had to change the
// add to watchlist when client is initially present or added
for (const client of workspace.clientList()) {
onAdded(client);
}
workspace.clientAdded.connect(onAdded);
to other kind of for loop
// add to watchlist when client is initially present or added
const clients = workspace.clientList();
for (var i = 0; i < clients.length; i++) {
onAdded(clients[i]);
}
workspace.clientAdded.connect(onAdded);
My guess is that I'm on older version of Kwin that doesnt support the kind of iteration for for loops you used. Now it works just fine for me!
That sounds plausible, kudos for figuring that one out. I'm glad to hear it works now.
Which KWin version are you using (kwin_x11 --version
)? Depending on how old it is, I might consider rewriting the script for broader compatibility.
kwin_x11 --version
kwin 5.21.4
Okay, thank you!
Hi, been looking for a script like this for a long while so I'm glad to see one
Unfortunately I can't get mine to work. I have it loaded in my Kwin Scripts settings, but the config button won't appear even after following the readme.
Here's what I get after running
kwin_x11 --replace &