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

How to get virtual desktop name ?

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

How to get virtual desktop name ?

Wed Jun 12, 2019 2:26 pm
Hello guys !

I'm trying to create an alias who can take the name of the virtual desktop to put it in the command.

My virtual desktop name is "project01 / project02 / job01 / etc .. " and I would like a command to take this name automatically.

in exemple : cd ''the command i need'' to automatically go in the folder with the name of the desktop.

Not sure if I'm clear :p

Thanks !
airdrik
Registered Member
Posts
1854
Karma
5
OS
My first thought is to use Activities, because you can associate files with activities through a context menu entry in Dolphin. Once associated, they can be looked up using the activities:/current KIO path.
The downside to this is that the KIO path is only usable by KIO-enabled apps (basically KDE apps).

As for doing this using Desktops, digging into the dbus commands, I found that you can use: "qdbus org.kde.KWin /KWin currentDesktop" to get the ID of the current desktop. I'm not familiar enough with the protocols to get you from the desktop id to the name, though. At the very least you can throw something together to map the desktop ids to the names you want.

(another plug for Activities: you can look up the name of the current activity by first using "qdbus org.kde.ActivityManager /ActivityManager/Activities CurrentActivity" to get the UUID for the current activity and then passing that in to "qdbus org.kde.ActivityManager /ActivityManager/Activities ActivityName <activity-UUID>" to get the name)


airdrik, proud to be a member of KDE forums since 2008-Dec.


Bookmarks



Who is online

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