LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-25-2010, 04:03 PM   #1
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
How to start program when fluxbox starts?


I use NetworkManager to handle my net connections and it's applet that allows me to control everything from the gui is called nm-applet. I was able to edit /etc/X11/xinit/xinitrc.fluxbox so that nm-applet starts when fluxbox does and away I go. From runlevel 3 that is.

On my laptop I like to boot into runlevel 4 for various reasons. When I start a fluxbox session from runlevel 4 this doesn't happen. What file do I have to edit to get this to start from runlevel 4?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-25-2010, 04:16 PM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
~/.fluxbox/startup is a good choice
 
1 members found this post helpful.
Old 04-25-2010, 04:25 PM   #3
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Original Poster
Rep: Reputation: 201Reputation: 201Reputation: 201
I've tried editing that every way I can think of and copy pasting from the fluxbox wiki, but I just can't get nm-applet to start with flux from rl 4. It works perfect from rl 3. What is the difference in the way flux gets started from the different runlevels?
 
Old 04-25-2010, 04:30 PM   #4
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,049

Rep: Reputation: 170Reputation: 170
Can we have a look-see at your .fluxbox/startup for curiosity's sake?

cheers,
 
1 members found this post helpful.
Old 04-25-2010, 04:46 PM   #5
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Original Poster
Rep: Reputation: 201Reputation: 201Reputation: 201
Code:
#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# Change your keymap:
xmodmap "/root/.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 &


# 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
{
   # Applications you want to run after fluxbox has started
   # MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.
   # ipager &
   # gkrellm2 &
   nm-applet &
} &
 
wait $fbpid

# or if you want to keep a log:
# exec fluxbox -log "/root/.fluxbox/log"
 
Old 04-25-2010, 05:00 PM   #6
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 492
Blog Entries: 1

Rep: Reputation: 55
This may not apply to you, but when I was using XFCE, I installed gdm from
SBo as my display manager. When I switched to fluxbox, the startup script did not get read. I didn't delve into the why, but switching to SLiM solved my problems.
Regards,
Bill
 
Old 04-25-2010, 05:11 PM   #7
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Original Poster
Rep: Reputation: 201Reputation: 201Reputation: 201
It may very well be that gdm is ignoring the startup script.
 
Old 04-25-2010, 05:32 PM   #8
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 293Reputation: 293Reputation: 293
Your startup file is borked:

Delete this line:

'fluxbox &'

and uncomment the

'exec fluxbox'

line. The exec line should be to start flux and of course it should be the last line in startup. Just read the comments...

Last edited by dive; 04-25-2010 at 05:33 PM.
 
2 members found this post helpful.
Old 04-25-2010, 06:28 PM   #9
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Original Poster
Rep: Reputation: 201Reputation: 201Reputation: 201
From fluxbox wiki
Quote:
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.
 
0 members found this post helpful.
Old 04-25-2010, 07:06 PM   #10
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,049

Rep: Reputation: 170Reputation: 170
Ok - that's all news to me - I still use the *old* way (at least I think it may be the old way) to start programs after fluxbox starts by using the sleep command, thusly:

Code:
(sleep 15s && adesklets) &
#pidgin &
syndaemon &
conky &
guidance-power-manager &
wicd-client &
kmix &
(sleep 30s && sshl) &
exec fluxbox
See if that makes a difference....

cheers,
 
Old 04-25-2010, 07:08 PM   #11
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Original Poster
Rep: Reputation: 201Reputation: 201Reputation: 201
It seems to have been a GDM issue. Since I knew that my xinitrc.fluxbox file worked as I wanted to, I just created a link to it called /etc/X11/xinit/Xclients and then from the chooser I can just choose "run Xclients script" instead of fluxbox to start fluxbox with options. For some reason GDM doesn't seem to read the .fluxbox/startup script OR xinitrc.fluxbox script. Marking as solved.
 
Old 04-26-2010, 07:59 AM   #12
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,791
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
I don't know how official it is, but I've always used the ~/.fluxbox/apps folder to start things when fluxbox starts up. The syntax is drop dead easy and it doesn't seem to care what runlevel I use. This is what mine looks like:

Code:
[startup]   {conky}
[startup]   {kmix}
[startup]   {xfce-mcs-manager}
[startup]   {wicd-client}
[startup]   {hp-systray}
[startup]   {wbar -p right -vbar -bpress}
[app] (VCLSalFrame)
[end]
 
1 members found this post helpful.
Old 04-26-2010, 08:39 AM   #13
BILLYKANE
Member
 
Registered: Feb 2008
Location: Hefei,Anhui,China
Distribution: Slackware;chakra
Posts: 96

Rep: Reputation: 22
Quote:
Originally Posted by dive View Post
Your startup file is borked:

Delete this line:

'fluxbox &'

and uncomment the

'exec fluxbox'

line. The exec line should be to start flux and of course it should be the last line in startup. Just read the comments...
I agree with you.:

Code:
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# You can set your favourite wallpaper here if you don't want
# to do it from your style.
#
fbsetbg -f ~/.fluxbox/back.jpg
#
# This sets a black background

#/usr/bin/fbsetroot -solid black

# This shows the fluxbox-splash-screen
#fbsetbg -C ~/.fluxbox/back.jpg
#fbsetbg -f ~/.fluxbox/back.jpg
# Other examples. Check man xset for details.
#
# Turn off beeps:
# xset -b
#
# Increase the keyboard repeat-rate:
# xset r rate 195 35
#
# Your own fonts-dir:
# xset +fp "/home/hudi/.fonts"
#
# Your favourite mouse cursor:
# xsetroot -cursor_name right_ptr
#
# Change your keymap:
# xmodmap "/home/hudi/.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 &
#xidesk &
#sleep 5 &
#Swmpager &
conky &
wbar -pos bottom &
scim.sh &
wmix % &
ipager &




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

exec /usr/bin/fluxbox
# or if you want to keep a log:
# exec /usr/bin/fluxbox -log "/home/hudi/.fluxbox/log"

And startup should be chmod +x.
That works fine for me.
 
1 members found this post helpful.
Old 04-26-2010, 09:30 AM   #14
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,574

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
You may want to look inside /etc/X11/gdm/Xsession to see what is going on. It appears that putting such things inside ~/.xprofile that you always want to run in your X sessions would be one way to start this stuff. You could examine $command in your script if what you wanted to run was dependent on the window manager.
 
Old 07-19-2012, 02:10 AM   #15
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Original Poster
Rep: Reputation: 201Reputation: 201Reputation: 201
I realize that this thread is around 2 years old, but googling for the same answer again that I thought I'd found before, and screwing up in exactly the same way as before, I realized that everyone was right. Simply adding nm-applet to ~/.fluxbox/startup AND, I reapeat AND
Code:
 chmod +x ~/.fluxbox/startup
worked exactly like it was supposed to. Just wanted to give credit where it was due, and make sure that if anyone else that wound up finding this thread knew that the answer was in fact here and much simpler than what I had done! LOL, sometimes I'm a little slow!
Code:
#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# Change your keymap:
xmodmap "/root/.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 &
nm-applet &



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

exec fluxbox
# or if you want to keep a log:
# exec fluxbox -log "/root/.fluxbox/log"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I start applications after fluxbox starts? kav Linux - Desktop 3 12-15-2006 02:51 PM
Two Fluxbox Versions - Root starts newest,User starts oldest fortezza Linux - Software 1 05-21-2006 02:17 AM
NVIDIA Driver Problems / Start program when X starts up brent0324 Suse/Novell 1 03-05-2005 08:52 AM
How do I start a program automatically when KDE starts up? zmaint Linux - Software 8 12-21-2004 05:52 PM
How to starts FluxBox chem1 Linux - Software 2 05-09-2003 11:50 PM


All times are GMT -5. The time now is 09:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration