I want to run a slightly different bash command depending on which Xfce workspace I am running on. How can I get the Xfce workspace name (or some unique number) for the current workspace on the bash commandline. Well actually from an alias.
Asked
Active
Viewed 360 times
2 Answers
1
xprop -root -notype _NET_CURRENT_DESKTOP
This works from a bash terminal in Xfce on CentOS 7.
I found the answer here, but the accepted answer there didn't work for me.

WestHamster
- 1,297
- 2
- 11
- 16
0
From askubuntu Is there a way to detect which workspace you are currently in from the command line? I have glued the following script:
workspace=$(xdotool get_desktop)
case "$workspace" in
0) one_command; ;;
1) another_command; ;;
esac

KamilCuk
- 120,984
- 8
- 59
- 111
-
Sounds good. I'm on CentOS 7 and I don't have access to xdotool unfortunately though. – WestHamster Feb 11 '20 at 14:20
-
Try finding it with `wmctrl` or maybe somewhere it will be listed in `xfce4-query` – KamilCuk Feb 11 '20 at 14:24
-
I don't have wmctrl at my disposal either. Doh! – WestHamster Feb 11 '20 at 14:27