I’ve tried to follow the steps here so that print statements in a KWin script generate output to the journal:
- In
kdebugsettings, set the level for KWin Scripting to Full Debug - I also noticed a custom rule
*.debug=false, so I deleted that - Added an script in
/etc/environment.d/to setQT_LOGGING_RULES="kwin_*.debug=true" - Restarted, and verified that
echo $QT_LOGGING_RULESshowskwin_*.debug=true
However, I still don’t get print output in the journal.
As a minimal test, I execute this script from the KWin interactive console:
workspace.windowActivated.connect(function(client){
print('signal fired');
});
I expect to see a journal entry saying “signal fired” each time a window is activated, but nothing appears.
Now, I’m pretty sure that this way of registering handlers does work, because when I execute this from the KWin interactive console:
workspace.windowActivated.connect(function(client){
print(client.caption);
});
then I get errors in the journal like:
Oct 23 13:40:52 kwin_wayland[2157]: file:///home/me/.local/share/plasma-interactiveconsole/interactiveconsoleautosave.js:2: TypeError: Cannot read property 'caption' of null
which wouldn’t appear if the listener function did not run.
So as far as I can tell, I have successfully attached a listener to the windowActivated signal, but when the listener tries to print something, it doesn’t make it to the journal.
What could I do to troubleshoot further?
My kinfo:
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2
Kernel Version: 6.17.4-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Memory: 32 GiB of RAM (31.3 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3060 Ti