Bug 498561 - workspace.screens undefined
Summary: workspace.screens undefined
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kwin
Classification: Plasma
Component: scripts (other bugs)
Version First Reported In: 5.27.11
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-12 14:37 UTC by Kalle Hallivuori
Modified: 2025-01-13 00:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kalle Hallivuori 2025-01-12 14:37:53 UTC
SUMMARY
`workspace.screens` is not available although it should according to https://develop.kde.org/docs/plasma/kwin/api/#read-only-properties-1

STEPS TO REPRODUCE
1. `sudo less +F /var/log/syslog`
2. `plasma-interactiveconsole --kwin`
3. Execute script: `print(workspace.screens)`

OBSERVED RESULT
`undefined`

EXPECTED RESULT
`[<Screen0>, <Screen1>, <Screen2>]`

SOFTWARE/OS VERSIONS
Windows: -
macOS: -
(available in the Info Center app, or by running `kinfo` in a terminal window)
Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-51-generic (64-bit)
Graphics Platform: offscreen
Processors: 12 × AMD Ryzen 5 5500
Memory: 31.1 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2

ADDITIONAL INFORMATION
In order to be able to develop key shortcuts for relocating windows, I have been repeating a loop of
1. install a kwinscript that installs keyboard shortcuts
2. logout from KDE (to SDDM login screen)
3. remove the installed entries from ~/.config/kglobalshortcutsrc
4. log in to KDE (same credentials, via SDDM)
I cannot see how this could break kwin but mentioning for completeness.
Comment 1 fanzhuyifan 2025-01-13 00:03:33 UTC
As noted in the referenced document, it describes KWin Scripting API as of KWin 6.0. Please try this on a newer version of kde plasma (e.g., 6.2).