[openbox] I Have Two Instances Of 'autostart.sh Running...

R. Mattes rm at mh-freiburg.de
Wed Oct 22 11:45:36 EDT 2014


On Wed, 22 Oct 2014 11:27:32 -0400, Dana Jansens wrote
> BTW Openbox runs autostart after it has started up now, instead of before, so those sleeps may be unnecessary with an up-to-date Openbox.

As I said, my autostart works fine without any sleep invocations. That strange and silly (sleep ... & ...) seems to
come from the Arch-Wiki page at https://wiki.archlinux.org/index.php/openbox#autostart. Maybe someone should 
fix that page ;-)

 Cheers, RalfD

> On Wed, Oct 22, 2014 at 8:32 AM, R. Mattes <rm at mh-freiburg.de> wrote:
> On Wed, 22 Oct 2014 01:02:14 -1000, E R wrote
> > I don't see anything complicated about this. The way I have the two
> > sleep lines is a common way of doing this, this method has been
> > practied this way for many years in Linux...
> 
> Somehow, some of us here seem to get the impression that you don't
> really unerstand your own shell program ...
> 
> > I don't see any behind the keyboard errors here, LMAO, if so, someone
> > please point it out in that copy of my autostart.sh below...
> >
> > # This shell script is run before Openbox launches.
> > # Environment variables set here are passed to the Openbox session.
> >
> 
> > (sleep 1s && tint2) &
> > (sleep 2s && redshift-gtk >/dev/null 2>&1) &
> 
> So, here you run two subshells. Each subshell will execute /bin/sleep [1],
> wait for sleep to exit, an then look at sleeps return code, and, if
> sleep exited with return value 0, run the next program (tint2 or
> redshift-gtk). Now, do you really expect 'sleep' to fail??? Most likely
> not, so you might change this to
> 
>  (sleep 1s; tint2)&
> 
> Next question: how long do you expect those subschells to run? The way
> you programmed this, the shell will terminate once the last program it
> invoked terminates. So, as long as tint2 or redshift-k run, you'll see
> to shell processes in your top/ps output. Not what you want - so write
> it like this:
> 
>  ( sleep 1s; tint2 & ) &
> 
> That way the subshell forks tint2 and terminates. No more shell
> processes arround.
> 
> > /usr/lib64/xfce4/notifyd/xfce4-notifyd &
> > /usr/bin/xbindkeys &
> > eval `cat $HOME/.fehbg`
> 
> That's a rather baroque way of doing this: a normal .fehbg file contains
> an invokation of feh like this: feh --bg-fill .... which will terminate
> feh.
> So, a simple:
> 
>  sh $HOME/.fehbg
> 
> or even_
> 
>  . $HOME/.fehbg
> 
> will do.
> BTW: I never saw the need for all those sleep invokations, in my
> autostart I'll just run
> 
> tint2 &
> 
> et al.
> 
> HTH Ralf MAttes
> 
> [1] Actually, it probably won't run an external program but rather
> invoke the shell's buildin sleep command ....
> 
> _______________________________________________
> openbox mailing list
> openbox at icculus.org
> http://icculus.org/mailman/listinfo/openbox
>

-- 
R. Mattes - 
Hochschule fuer Musik Freiburg 
rm at mh-freiburg.de

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/openbox/attachments/20141022/b09e9c2f/attachment-0001.html>


More information about the openbox mailing list