openbox autostart configuration

the autostart configuration (~/.config/openbox/autostart.sh) isn’t being executed when i login.
autostart.sh is owned by me and is executable.
i had installed opensuse 12.2 x86_64 with LXDE from the DVD and i am using the openbox session.

I’m not an Openbox user, but which version of Openbox are you using? A quick search tells me that 3.5 and later use ‘autostart’ rather than ‘autostart.sh’. So, the first thing to do is to remove the ‘.sh’ from the end of the name.

On 02/02/2013 06:26 AM, nishant no2 wrote:
>
> the autostart configuration (~/.config/openbox/autostart.sh) isn’t being
> executed when i login.

i am surprised to see the config is in your /home, is that how the
install instructions you followed said to do it?

or, maybe a better question: how did you install openbox? and, if not
via YaST or zypper, why not?


dd
http://tinyurl.com/DD-Caveat

As described here:

Help:Autostart - Openbox

You can use the autostart script to launch a panel, to set your desktop wallpaper, or anything else. Once Openbox starts, the system-wide default script, located at /etc/xdg/openbox/autostart, will be run. Then the user script at ~/.config/openbox/autostart is run afterward.

The LXDE installation came with openbox 3.5(from the OSS repo)
i had created a copy of autrostart.sh and named it autostart as well but to no avail.(i used ubuntu with openbox 3.5 for about a week and mageia 2 earlier as well with autostart.sh and not autostart and had no issues then)
i even copied the contents of my autostart to /etc/xdg/openbox/autostart but that didn’t work either

From what I can tell, it is executed when you start openbox alone, but not when you start LXDE. It probably used to work in the past … But it’s an LXDE issue, not openbox.

I added an echo in my ~/.config/openbox/autostart.sh and started X (using startx, sorry) with openbox and lxde. See the log below:

********************************************
/etc/X11/xinit/xinitrc: Beginning session setup on Fri Feb  1 23:39:57 PST 2013...
 - sourcing /etc/X11/xinit/xinitrc.d/libcanberra-gtk-module.sh
non-network local connections being added to access control list
 * starting gnome-keyring-daemon
gnome-keyring-daemon: insufficient process capabilities, unsecure memory might get used
sourcing /usr/local/config/x11/Xresources.icewm
/etc/X11/xinit/xinitrc: Setup done, will execute: **openbox-session**.
********************************************

**running /home/openSUSE/agnelo/.config/openbox/autostart.sh**

********************************************
/etc/X11/xinit/xinitrc: Beginning session setup on Fri Feb  1 23:43:37 PST 2013...
 - sourcing /etc/X11/xinit/xinitrc.d/libcanberra-gtk-module.sh
non-network local connections being added to access control list
 * starting gnome-keyring-daemon
gnome-keyring-daemon: insufficient process capabilities, unsecure memory might get used
sourcing /usr/local/config/x11/Xresources.icewm
/etc/X11/xinit/xinitrc: Setup done, will execute: **startlxde**.
********************************************

i am using the openbox-session not the lxde session

Since LXDE is your DE, then this may be relevant:

LXSession - LXDE.org

LXDE.org Forum • View topic - applications autostart [SOLVED]

Otherwise you may have to wait until an LXDE user chimes in…

Hmm, interesting! As you can see, it just worked for me. I haven’t tried to log in from a DM though, but it should not be different.
You might try to add an echo at the top of your autostart.sh and see if it appears in your ~/.xsession-errors (or whichever file you use to log X session messages). This is what I used:

echo running $0

You can see what it printed in my previous post.

What did you write inside that autostart ?
Can you share what you wrote inside “autostart” in paste.opensuse.org
Can you check whether there are any syntax errors in the “startup” file?
How do you know that it is not executed ?

here is the log.


/etc/X11/xim: Checking whether an input method should be started.
sourcing /etc/sysconfig/language to get the value of INPUT_METHOD
INPUT_METHOD is not set or empty (no user selected input method).
Trying to start a default input method for the locale en_US.UTF-8 ...
There is no default input method for the current locale.
Dummy input method "none" (do not use any fancy input method by default)

here is my autotart


numlockx on &
sh ~/.fehbg &
tint2 &
nm-applet &
pnmixer &
conky &
synapse -s &
echo running $0

there are no issues when i manually execute autostart.

Try creating ~/.config/lxsession/LXDE/autostart and adjust the syntax accordingly:

LXDE - basic settings - Linux commands

Move the echo line to the top though!

Yes, but the OP said that he’s using standalone openbox session, not LXDE. The autostart he has should work in this case. It does for me.

Well that’s what I initially thought, but I’m not clear how LXDE fits into all of this… happy to be educated.

LXDE is a DE only. It doesn’t “include” a window manager. It uses openbox by default, but could use another one.
openbox is a wm only. It doesn’t have a desktop (taksbar, etc), but has some application menus (usually processed on the fly).

openbox can be use as a standalone session (openbox-session) without LXDE or any other desktop. The last command it executes is:

# Run Openbox, and have it run the autostart stuff
exec /usr/bin/openbox --startup "/usr/lib/openbox-autostart OPENBOX" "$@"

The script /usr/lib/openbox-autostart shows how it handles autostart stuff. Here’s this script:

# cat /usr/lib/openbox-autostart
#!/bin/sh

# Set a background color
BG=""
if which hsetroot &>/dev/null; then
  BG=hsetroot
elif which esetroot &>/dev/null; then
  BG=esetroot
elif which xsetroot &>/dev/null; then
  BG=xsetroot
fi
test -z $BG || $BG -solid "#303030"

GLOBALAUTOSTART="/etc/xdg/openbox/autostart"
**AUTOSTART="${XDG_CONFIG_HOME:-"$HOME/.config"}/openbox/autostart"**

# Run the global openbox autostart script
if test -f $GLOBALAUTOSTART; then
    sh $GLOBALAUTOSTART
elif test -f $GLOBALAUTOSTART.sh; then
    sh $GLOBALAUTOSTART.sh
fi

**# Run the user openbox autostart script
if test -f $AUTOSTART; then
    sh $AUTOSTART
elif test -f $AUTOSTART.sh; then
    sh $AUTOSTART.sh
fi**

# Run the XDG autostart stuff.  These are found in /etc/xdg/autostart and
# in $HOME/.config/autostart.  This requires PyXDG to be installed.
# See openbox-xdg-autostart --help for more details.
/usr/lib/openbox-xdg-autostart "$@"

It should become obvious that the user autostart script is executed, whether you are on a freedesktop compliant desktop, in which case XDG_CONFIG_HOME is set, or not, since HOME is set anyway.

I don’t see why it doesn’t work for the OP.

@deano_ferrari

About ~/.config/lxsession/LXDE/autostart you mentioned earlier, I guess that’s what used to work but doesn’t work anymore. I vaguely remember that I already wrote such scripts for LXDE. Now I don’t see them anymore. It might be deprecated.

But it’s not relevant for standalone openbox, or openbox as an alternate wm for other desktops (including KDE).

Thanks for posting the /usr/lib/openbox-autostart script. Yes, it’s a mystery…

I can reproduce it by adding this in my xinitrc (because I’m using startx):

 unset XDG_CONFIG_HOME HOME

But who would do something like that? lol!

Notice that - provided python-xdg is installed - openbox-session can run XDG autostart stuff, like any other freedesktop compliant DE:

# Run the XDG autostart stuff.  These are found in /etc/xdg/autostart and
# in $HOME/.config/autostart.  This requires PyXDG to be installed.
# See openbox-xdg-autostart --help for more details.
/usr/lib/openbox-xdg-autostart "$@"

Thus you certainly don’t need to start nm-applet from this script - nor to start it twice. This is what I’m using (system wide) for conky:

# cat /etc/xdg/autostart/conky.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=conky
Exec=conky.sh
StartupNotify=false
Terminal=false
Hidden=false
X-KDE-autostart-phase=2
NotShowIn=KDE;
X-GNOME-Autostart-enabled=true

You migh want to replace conky.sh with conky here, since you don’t have this script.
Both this .desktop file and conky.sh are included in package conkyconf available in my repo.