13

Is there a way to set the number of rows for desktop workspaces without using the xfce-panel applet "Workspace Switcher"?

I don’t run xfce-panel at all, preferring to use cairo-dock.

Vladashram
  • 282
  • 4
  • 13
  • 1
    The answers below, which suggest `xprop` to manually set the workspaces, do not seem to work in Xubuntu 14.04 (Xfce 4.10). This question might need a new answer that works in recent Xfce releases. –  Dec 09 '15 at 09:26
  • This question reappeared in my recent search, so I tested below answers again; Now seem to work in both Xubuntu 12.04 (Xfce 4.8) and Xubuntu 14.04 (Xfce 4.10). Not sure what caused `xprop` to not work sometimes. –  Feb 17 '17 at 14:12

3 Answers3

8

It's possible to manually set the _NET_DESKTOP_LAYOUT property using the xprop command.

For example, to get 4 columns x 2 rows, issue this:

xprop -root -f _NET_DESKTOP_LAYOUT 32cccc -set _NET_DESKTOP_LAYOUT 0,4,2,0

And to change the number of workspaces/desktops to 8:

xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS 8

Further information regarding the _NET_DESKTOP_LAYOUT property (among others) can be found here

Aditya
  • 13,256
  • 17
  • 64
  • 95
piLON
  • 81
  • 1
  • 2
5

Since one of the comments above suggested that this feature was removed I searched through the settings and found a way without doing it manually. I am currently using Ubuntu 16.04.4LTS .

With a Rightclick on the the Workspace Switcher in one of the panels (see screenshot below) you can open the respective contex menu. From there you can choose Properties. The window is shown in the second screenshot below. Here you can choose a number of rows to be used for the workspaces. The number of workspaces will then be distributed from top to bottom.

Workspace Switcher in Panel

Workspace Switcher

Stephen Rauch
  • 1,156
  • 6
  • 14
  • 20
LuckyJosh
  • 51
  • 1
  • 2
4

Building off of Pierre's answer, once you've found the right layout, you should add the line to the end of your ~/.profile.

For instance, I prefer to have a 2x2 grid of workspaces, so I added this line to the end of my .profile:

xprop -root -f _NET_DESKTOP_LAYOUT 32cccc -set _NET_DESKTOP_LAYOUT 0,2,2,0

Now the grid should persist between logins.

I'm running Xubuntu 14.04, and I've got to say it's so frustrating that they've removed easy access to this feature from the workspace settings.

Maura
  • 143
  • 5
  • 1
    re: adding it to `~/.profile`. I found a [sleep was required](https://askubuntu.com/questions/876232/why-does-xprop-f-net-number-of-desktops-not-have-an-effect-when-run-in) to have it take effect. – Pod Jan 25 '17 at 22:41
  • Just logging out should be sufficient. – Maura Jan 26 '17 at 04:46
  • it's when I log in that's the problem ;) – Pod Jan 26 '17 at 07:01
  • That's odd behavior, honestly. The .profile should be loaded fresh with every login. – Maura Jan 31 '17 at 00:06
  • 1
    It is, but it turns out there's a [timing problem](http://askubuntu.com/questions/876232/why-does-my-xprop-command-fail-on-login-if-i-run-it-from-profile) – Pod Jan 31 '17 at 08:37