Click to See Complete Forum and Search --> : How to automagically start apps when Fluxbox starts


nibznik
11-02-2004, 07:40 PM
<split this from the screenshots thread>

does anyone know how to start app automatically on startup in flux? because I've tried and im just no working

lates

cybertron
11-02-2004, 08:26 PM
A couple of possibilities: 1) On the Mandrake RPM of flux you can put a script named "startup" in your .fluxbox directory and anything in there gets run when flux starts. Make sure that anything you run that keeps running has an & after it. However, this method doesn't seem to work for non-Mandrake RPM version (not sure why), which leads me to 2) add the commands to your ~/.xinitrc or /etc/X11/xinit/xinitrc file. I suspect that the one you need to use depends on how X is started on your system. If you do startx as a user, then .xinitrc is the way to go. If X is started automatically at boot (like Mandrake) I'm guessing it needs to go in the /etc one.

I imagine there are other ways to do it too, but these are the ones I know of.

Also, I think there's something in the fluxbox docs (http://fluxbox.sf.net/docbook.php) about it too.

Uranus
11-03-2004, 02:57 AM
Make the file /etc/X11/Sessions/Fluxbox (or fluxbox, or whatever) to run the user's .xsession - add the line:
sh $HOME/.xsession &
Using the sh command you don't even have to make it executable - saves a lot of confusion, since many users make the mistake of not having it executable. Then put the commands you want to run in your .xsession file with an & (background) sign at the end of the line - eg my .xsession:
gkrellm2 &
/usr/libexec/gnome-settings-daemon &
Esetroot -fit /home/sam/images/wallpapers/cyberpun.jpg &
devilspie &

If you're using gdm, you have to choose "Custom Session" as the session, and add "/path/to/startfluxbox" (without &) at the end of the file.

HTH
Sam

blobaugh
11-03-2004, 01:26 PM
the way i got mine to load was in $HOME/.xinitrc:

programname &
programname &

exec fluxbox

Fenster
11-03-2004, 01:48 PM
Another way is to edit the .fluxbox/init file. There's a line in it as below:

session.screen0.rootCommand:

Any command you add here will be run when Fluxbox starts up. Just put | to seperate them:

session.screen0.rootCommand: gkrellm -w | fbsetbg -l | fbpager | xscreensaver -no-splash | gaim

blobaugh
11-03-2004, 02:44 PM
that's a cool way, i never thought about that. probably a better way than my method

Fenster
11-03-2004, 03:10 PM
If nothing else, its more elegant. :)

knute
11-03-2004, 03:40 PM
Originally posted by Fenster
Another way is to edit the .fluxbox/init file. There's a line in it as below:

session.screen0.rootCommand:

Any command you add here will be run when Fluxbox starts up. Just put | to seperate them:

session.screen0.rootCommand: gkrellm -w | fbsetbg -l | fbpager | xscreensaver -no-splash | gaim

The more elegant way would be to set it up like this:
session.screen0.rootCommand: sh /home/user/.fluxbox/startup
/home/user/.fluxbox/startup file

gkrellm -w &
fbsetbg -l &
fbpager &
xscreensaver -no-spalsh &
gaim &


Not sure if you need to put the scripting stuff of # !bash or not. It's something to play with though.

Fenster
11-03-2004, 04:59 PM
I tried a script originally, but it got hung up on it.

Uranus
11-03-2004, 05:05 PM
I personally don't think using rootCommand is an elegant way - basically it's just a hack, since rootCommand is meant as the place to define your wallpaper and the tool used to set it.
I think putting it where it should be (as in, where the default is) is the most elegant - which is (with startx) the .xinitrc file
Sam

blobaugh
11-03-2004, 05:07 PM
ok guys, calm down. it's all preference, it doesnt matter how it gets done as long as it gets done


700 posts!!