This forum has been archived. All content is frozen. Please use KDE Discuss instead.

get active desktops from dbus

Tags: None
(comma "," separated)
Lukas1818
Registered Member
Posts
1
Karma
0

get active desktops from dbus

Thu Jun 02, 2022 8:50 pm
I have try to get a list of actives screens by using dbus and executeing `desktops()` at the PlasamaShell.

But I did get a loot of desktpos, with are not connected.

Code: Select all
WorkspaceScripting::Containment(0x5563135548e0)
objectName =
currentConfigGroup =
version = 3.0
configKeys = ItemGeometries-1707x1067,ItemGeometries-2560x1600,ItemGeometries-640x480,ItemGeometriesHorizontal,activityId,formfactor,immutability,lastScreen,location,plugin,wallpaperplugin
configGroups = Wallpaper,ConfigDialog
globalConfigKeys =
globalConfigGroups =
currentConfigGroup =
wallpaperPlugin = org.kde.image
wallpaperMode =
locked = false
type = org.kde.plasma.folder
formFactor = planar
widgetIds =
screen = -1
id = 71
objectNameChanged = function() { [native code] }
readConfig = function() { [native code] }
writeConfig = function() { [native code] }
readGlobalConfig = function() { [native code] }
writeGlobalConfig = function() { [native code] }
reloadConfig = function() { [native code] }
remove = function() { [native code] }
showConfigurationInterface = function() { [native code] }
widgetById = function() { [native code] }
addWidget = function() { [native code] }
widgets = function() { [native code] }


WorkspaceScripting::Containment(0x5563137bd180)
objectName =
currentConfigGroup =
version = 3.0
configKeys = ItemGeometries-1707x1067,ItemGeometries-1920x1080,ItemGeometries-1920x1200,ItemGeometriesHorizontal,activityId,formfactor,immutability,lastScreen,location,plugin,wallpaperplugin
configGroups = Wallpaper,ConfigDialog
globalConfigKeys =
globalConfigGroups =
currentConfigGroup =
wallpaperPlugin = org.kde.image
wallpaperMode =
locked = false
type = org.kde.plasma.folder
formFactor = planar
widgetIds =
screen = -1
id = 94
objectNameChanged = function() { [native code] }
readConfig = function() { [native code] }
writeConfig = function() { [native code] }
readGlobalConfig = function() { [native code] }
writeGlobalConfig = function() { [native code] }
reloadConfig = function() { [native code] }
remove = function() { [native code] }
showConfigurationInterface = function() { [native code] }
widgetById = function() { [native code] }
addWidget = function() { [native code] }
widgets = function() { [native code] }


WorkspaceScripting::Containment(0x5563137b2980)
objectName =
currentConfigGroup =
version = 3.0
configKeys = ItemGeometries-1920x1080,ItemGeometriesHorizontal,activityId,formfactor,immutability,lastScreen,location,plugin,wallpaperplugin
configGroups = Wallpaper
globalConfigKeys =
globalConfigGroups =
currentConfigGroup =
wallpaperPlugin = org.kde.image
wallpaperMode =
locked = false
type = org.kde.plasma.folder
formFactor = planar
widgetIds =
screen = 3
id = 110
objectNameChanged = function() { [native code] }
readConfig = function() { [native code] }
writeConfig = function() { [native code] }
readGlobalConfig = function() { [native code] }
writeGlobalConfig = function() { [native code] }
reloadConfig = function() { [native code] }
remove = function() { [native code] }
showConfigurationInterface = function() { [native code] }
widgetById = function() { [native code] }
addWidget = function() { [native code] }
widgets = function() { [native code] }


WorkspaceScripting::Containment(0x5563134cf7a0)
objectName =
currentConfigGroup =
version = 3.0
configKeys = ItemGeometries-1920x1080,ItemGeometries-1920x1200,ItemGeometriesHorizontal,activityId,formfactor,immutability,lastScreen,location,plugin,wallpaperplugin
configGroups = Wallpaper
globalConfigKeys =
globalConfigGroups =
currentConfigGroup =
wallpaperPlugin = org.kde.image
wallpaperMode =
locked = false
type = org.kde.plasma.folder
formFactor = planar
widgetIds =
screen = 3
id = 111
objectNameChanged = function() { [native code] }
readConfig = function() { [native code] }
writeConfig = function() { [native code] }
readGlobalConfig = function() { [native code] }
writeGlobalConfig = function() { [native code] }
reloadConfig = function() { [native code] }
remove = function() { [native code] }
showConfigurationInterface = function() { [native code] }
widgetById = function() { [native code] }
addWidget = function() { [native code] }
widgets = function() { [native code] }


WorkspaceScripting::Containment(0x55631392aa90)
objectName =
currentConfigGroup =
version = 3.0
configKeys = activityId,formfactor,immutability,lastScreen,location,plugin,wallpaperplugin
configGroups = Wallpaper
globalConfigKeys =
globalConfigGroups =
currentConfigGroup =
wallpaperPlugin = org.kde.image
wallpaperMode =
locked = false
type = org.kde.plasma.folder
formFactor = planar
widgetIds =
screen = 0
id = 112
objectNameChanged = function() { [native code] }
readConfig = function() { [native code] }
writeConfig = function() { [native code] }
readGlobalConfig = function() { [native code] }
writeGlobalConfig = function() { [native code] }
reloadConfig = function() { [native code] }
remove = function() { [native code] }
showConfigurationInterface = function() { [native code] }
widgetById = function() { [native code] }
addWidget = function() { [native code] }
widgets = function() { [native code] }


First I had thought I could check if `screen >= 0` but this does not match witch the count of connected monitors.
Exist their any option, to determine, with desktop is active? So I can set a special wallpaper to it?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: get active desktops from dbus

Fri Jun 03, 2022 8:47 am
Hi!

You can get the virtual desktops using
Code: Select all
qdbus --literal org.kde.KWin /VirtualDesktopManager org.freedesktop.DBus.Properties.Get org.kde.KWin.VirtualDesktopManager desktops
# or all properties using
qdbus --literal org.kde.KWin /VirtualDesktopManager org.freedesktop.DBus.Properties.GetAll org.kde.KWin.VirtualDesktopManager


But I think you are looking for Activities instead:
Code: Select all
qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ListActivities

Wallpapers are set per Activity afaik.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]