0

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.

WestHamster
  • 1,297
  • 2
  • 11
  • 16

2 Answers2

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.

Detecting which workspace you're in from the command line

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