You are not logged in.

#1 2012-01-20 05:22:10

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,634
Website

How to use the sleep function in autostart.sh (Openbox) in Fluxbox

How do I start an application after fluxbox starts

This is pretty easy to do, and for some apps like gdesklets is often needed. The best thing to do is to edit your existing startup script and remove the line:

exec fluxbox

Then replace it with the following:

fluxbox &
fbpid=$!

sleep 1
{
   # Applications you want to run after fluxbox has started
   # MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.
   # ipager &
   # gkrellm2 &
} &
 
wait $fbpid

Probably the most easily-overlooked change here is the line fluxbox &, especially the & character. This will start fluxbox in the background and is required so that the other later programs will start! Note how we save fluxbox's pid in the shell variable $fbpid and then at the very end use wait to prevent us from exiting this script until fluxbox exits.

Notice the sleep 1: this is where we tell our apps how long to wait before they start. If you need to wait 10 seconds before starting the app, fluxbox will already be running so setting sleep 10 will not affect how long fluxbox itself takes to start; this will just mean there is a 10 second delay before your application starts. You could have multiple "sleep" sections, to start some applications later than others.

source: http://fluxbox-wiki.org/index.php?title … artup_file
Note that the start up file is in /home/user/.fluxbox.



Example line from autostart.sh:

(sleep 15 && pcmanfm-mod) &

becomes

fluxbox &
fbpid=$!

sleep 15
{
   # Applications you want to run after fluxbox has started
   # MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.
    pcmanfm-mod &
   } &
 
wait $fbpid

Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#2 2012-01-21 06:35:46

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,634
Website

Re: How to use the sleep function in autostart.sh (Openbox) in Fluxbox

Example of a startup script:

#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# Change your keymap:
xmodmap "/home/paul/.Xmodmap"

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &
numlockx &
adeskbar &
thunar --daemon &
parcellite &
nitrogen --restore &
conky -q &

# And last but not least we start fluxbox.
# Because it is the last app you have to run it with ''exec'' before it.

fluxbox &
fbpid=$!

sleep 5
{
    gnubiff &
   } &

sleep 15
{
   # Applications you want to run after fluxbox has started
   # MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.
    pcmanfm-mod &
   } &
 
wait $fbpid
# or if you want to keep a log:
# exec fluxbox -log "/home/paul/.fluxbox/log"

Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

Board footer

Powered by FluxBB