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

wmctrl -d: "Cannot get current desktop properties"

Tags: None
(comma "," separated)
raul_l
Registered Member
Posts
20
Karma
0
I cannot get the desktop ID anymore by using the wmctrl command:
Code: Select all
$ wmctrl -d
Cannot get current desktop properties. (_NET_CURRENT_DESKTOP or _WIN_WORKSPACE property)

This command only works if I first switch to another desktop and then back again:
Code: Select all
$ wmctrl -d
0  * DG: 1920x1080  VP: 0,0  WA: 32,0 1888x1080  Desktop 1
1  - DG: 1920x1080  VP: 0,0  WA: 32,0 1888x1080  Desktop 2
2  - DG: 1920x1080  VP: 0,0  WA: 32,0 1888x1080  Desktop 3
3  - DG: 1920x1080  VP: 0,0  WA: 32,0 1888x1080  Desktop 4

It's as if something is not initialized until the first time I change desktops. This should be easy to reproduce so hopefully someone can shed some light on this.

Alternatively, is there another way to get the desktop ID from the command line?
raul_l
Registered Member
Posts
20
Karma
0
For now, my solution to find out the desktop ID is the following:
Code: Select all
desktop=$(xprop -root | grep _NET_CURRENT_DESKTOP\( | awk '{print $3}')
[ "$desktop" == "" ] && desktop=0

The first command should return the desktop ID. If it doesn't, the ID is 0.
perk11
Registered Member
Posts
1
Karma
0
Getting the same error message in Kubuntu 18.04, but not in KDE Neon 15.11.

I'm trying to use https://github.com/mreq/wmctile which relies on this command for its --summon feature.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]