Monday, 13 June 2016

Raspberry Pi: adding extra desktops

As a Lubuntu/LXDE user, I hate many of the changes made to the Raspberry Pi desktop over recent years.


But I have to keep reminding myself that this little single board computer is not targeted towards me.


So this is a memo to me on how to add virtual desktops to a Pi, now that they have removed the Openbox Configuration Manager.

When the Pi first arrived in the world, the LXDE desktop layout was pretty familiar to me. The panel was at the bottom of the screen, and the menu groups and individual items where very similar to Lubuntu.

But as the product matured and the Foundation grew, someone was hired to re-work the desktop, and hide or remove things they felt unnecessary (or didn't understand).

The beauty of virtual desktops


One example is the ability to set the number of virtual desktops, a concept totally alien to many Windows users, but generally much loved by Linux people.

By running with a number of desktops (I generally use 4) you are able to click between desktops which are already laid out with an open application. This avoids much of the maximise/minimise operations that are needed if you just have a single desktop.

For me, it speeds up switching between applications. I also often have 2 or more documents open that use the same application. So desktops 1, 2 & 3 may all have open spreadsheets. I may often have multiple instances of file manager open (sometimes a mix of regular user and root instances).

I should hold my hand up and confess that I often have a lot of open applications. And that when I still had a day-job, I always had 2 physical screens connected to my work-station computer. This was something colleagues used to find amusing, until they eventually tried it for themselves, and became converts.

Adding desktops


So on the most recent Raspbian image, there are probably 2 or 3 ways to add extra desktops;

The hard way: you could open /home/pi/.conf/openbox/lxde-pi-rc.xml in a text editor and search for: <desktops>
It is then just a case of changing the <number> tag from 1 to whatever.
But you don't really want to do this.

Install the Open Box Configuration manager: this should give you an extra Preferences menu entry and you can then add desktops from there.

In a terminal:-
sudo apt install obconf

This will give you a new item in the Preferences menu: Openbox Configuration Manager

The preferred option:-
  1. Right click on the panel and select: Add/Remove Panel Items
  2. Select: Add
  3. Add the Desktop Pager
  4. Move the Pager up the list to suit your needs
  5. Go to menu > Preferences > Openbox Configuration Manager > Desktops
  6. Select the required Number of Desktops
  7. Close Menu editor and now select: Menu > Preferences > Desktop Preferences> Advanced
  8. Enable "Show menus provided by window manager when desktop is clicked"
  9. Right-click on the desktop > Desktops > Add new desktop

Once you have enough desktops, you can de-select "Show menus provided by..." if you prefer the default pop-up menu.

Top panel with 4 desktops to choose from

You can open your application in any desktop. You can also move an open application by clicking on the window header icon and selecting: Send to Desktop

...or you can drag the application window left or right, wait for the desktop to change, and then let go.

4 comments:

  1. I'm hoping your still persevering with the RPI and rasbian - as I agree about using virtual desktops (and the extra pain required).
    But to the point - there has been an introduced bug in the last 2 months that causes the desktops to interfere with each other (the edges of other frames in other desktops cause a desktop switch).
    Are you getting this too????
    (On latest and greatest raspbian and firmware on RPI3)
    Next step is to try and track down the code.....
    Paul S.

    ReplyDelete
    Replies
    1. Hi Paul, not sure what you mean about desktop switch. If I slide an app window so part of it is over a desktop side, the pager will step between desktops if the cursor is also touching the side. This is normal. The system is waiting for you to drop the app on another desktop. But you probably mean something quite different.

      I've updated Raspbian on my Pi3 and uname -a gives me: ...4.9.35-v7+ #1014 SMP Fri June 30 14:47:43 BST 2017...

      I notice that my preferred method above no longer works because "Desktop Preferences" no longer shows an "Advanced" option. However, adding a number to the lxde-pi-rc.xml file is quite easy.

      Delete
    2. Sorry, just modified the method in post (as this seems to work).

      Delete