#38 Logging in with LXSession breaks OBConf

closed-out-of-date
nobody
None
5
2014-07-05
2008-07-07
kdulcimer
No

When logged into an LXDE session, trying to use the Openbox configuration tool to change the theme is futile. It says it wants access to "/openbox/lxde-rc.xml".

Discussion

  • PCMan

    PCMan - 2009-06-25
    • status: open --> closed
     
  • PCMan

    PCMan - 2009-06-25

    This should be fixed in the latest openbox and obconf.
    Not a bug of lxsession itself.

     
  • PCMan

    PCMan - 2009-06-25
    • status: closed --> closed-out-of-date
     
  • Peter Nowee

    Peter Nowee - 2014-07-05

    IMHO, this is an issue that should be solved in LXDE, and it is still present in lxde-common-0.5.5.

    The file /usr/bin/openbox-lxde is a bash-script that assumes that the environment variable $XDG_CONFIG_HOME is set:

    exec openbox --config-file $XDG_CONFIG_HOME/openbox/lxde-rc.xml $@
    

    However, this variable is only set if /usr/bin/startlxde was run first. Although that should normally be the case, it is also possible to run lxsession directly, thereby bypassing startlxde.

    With $XDG_CONFIG_HOME then empty, openbox-lxde will execute:

    exec openbox --config-file /openbox/lxde-rc.xml $@
    

    This will eventually lead to the obConf error "An error occured while saving the config file '/openbox/lxde-rc.xml'", which I think is a correct error message, given the input openbox got from openbox-lxde.

    You might say users should not be running lxsession directly, but this mistake is easily made. For example, when changing the default session manager in my setup of Debian Wheezy 7.5, /usr/bin/lxsession is the first LX-related entry on the list:

    # update-alternatives --config x-session-manager
    There are 5 choices for the alternative x-session-manager (providing /usr/bin/x-session-manager).
    
      Selection    Path                             Priority   Status
    ------------------------------------------------------------
      0            /usr/bin/gnome-session            50        auto mode
      1            /usr/bin/gnome-session            50        manual mode
      2            /usr/bin/gnome-session-fallback   40        manual mode
    * 3            /usr/bin/lxsession                49        manual mode
      4            /usr/bin/openbox-session          40        manual mode
      5            /usr/bin/startlxde                50        manual mode
    
    Press enter to keep the current choice[*], or type selection number:
    

    In response to bug reports on this issue, the priority of lxsession was lowered in Debian's x-session-manager in 2009 and a remark was added to README.Debian about using startlxde in 2010. This instruction is also on the LXDE Debian Wiki and the Debian LXDE Wiki.

    Still, it seems I'm not the only one still accidentally running lxsession directly. Because the cause is difficult to find, people resort to hard-coding their home-folder into openbox-lxde (2009-2011), one even messing up her entire system (2013-2014) trying to solve the problems coming from this.

    So, even though this might be unexpected behaviour from the side of the user, I think it should be caught by /usr/bin/openbox-lxde.

    A solution would be to simply check (again, I know) for the existence of $XDG_CONFIG_HOME in openbox-lxde, before passing it into openbox --configfile. Suggested actions in case $XDG_CONFIG_HOME is not set:

    • Set $XDG_CONFIG_HOME to $HOME/.config, according to standard, and/or
    • Run openbox without the command-line option --config-file, and/or
    • Refuse to execute openbox, and/or
    • Give a warning or error-message (preferably in a user dialog box).
     
    Last edit: Peter Nowee 2014-07-05

Log in to post a comment.