2

I'm running Lubuntu 16.04. It's using openbox as its window manager. I wanted to configure the virtual desktops to be in a grid arrangement rather than a line, which I can do by running this command:

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

This works fine when run manually. So I've put that command in my ~/.profile, hoping that it would be executed on every login.

But it's not. :( Lubuntu boots, I login and the pager is still setup in a line. I have to manually run that command to get the desktop layout back.

.profile is being executed when I log in. I can tell this because the PATHS adjustments made in it are having an effect.

  1. How come it works when run in a terminal but not from .profile? (I've even done source ~/.profile rather than typing/copying the command to ensure it's correct in the file)
  2. Where's the appropriate file to put such a command for it to be properly executed?

Looking for any subsequent 'xprop' commands that might be overriding it I ran

grep -r xprop  .

and found a reference to a xprop failure in the file run.log. The log appears to be generated in each log in:

pod@lubuntu-vm:~$ grep -C3 xprop  ~/.cache/lxsession/Lubuntu/run.log 
** Message: utils.vala:79: Config system location : /etc/xdg/lxsession/Lubuntu
** Message: utils.vala:85: System system path location : /etc/xdg/lxsession/Lubuntu/conffiles.conf
** Message: utils.vala:89: Final file used : /etc/xdg/lxsession/Lubuntu/conffiles.conf
xprop:  no such property "_NET_NUMBER_OF_DESKTOPS"
xprop:  no such property "_NET_DESKTOP_NAMES"
** Message: options.vala:164: Activate xsettings_manager build-in
** Message: utils.vala:68: User config used : /home/pod/.config/lxsession/Lubuntu/desktop.conf
** Message: utils.vala:89: Final file used : /home/pod/.config/lxsession/Lubuntu/desktop.conf

But that's the only reference, and it's not the same property I'm trying to adjust.

Jacob Vlijm
  • 85,475
Pod
  • 123

1 Answers1

4

The issue

As I already mentioned in comments, the issue is timing. (commands to-) Configuring desktops is typically something that will break if the desktop isn't ready for it, and your command simply misses target. This often happens when running commands on configuring monitors, keyboards and mouse for example.

To solve

To solve the issue, you need to add a little break before the command is run. I don't run Lubuntu, but according to this post, you should be able to add a command to startup (login actually) here: Start Menu → Preferences → Default applications for LXSession → AutoStart. The command to add a little break is then:

/bin/bash -c "sleep 5 && xprop -root -f _NET_DESKTOP_LAYOUT 32cccc -set _NET_DESKTOP_LAYOUT 0,3,2,0"

Alternatively, (tested by you :) ), you can add it to ~/.profile, and add a & to make sure it will run in the background and not hold the login process.

Jacob Vlijm
  • 85,475