Discussion:
[Fluxbox-users] How do I start an application after fluxbox starts?
Jeff Schallenberg
2008-07-30 11:26:32 UTC
Permalink
I am using Fluxbox with Xubuntu 8.04.

I am trying to use the bbpager utility in the slit - it just works better
than fbpager and ipager on my little eeePC. But BBPager has the peculiarity
that it will not start until AFTER fluxbox is started.

When I was using BlackBox as a Window Manager, I was able to insert a "sleep
2 &" statement into the blackbox startup script.

So, how can I do that with FluxBox?I consulted the wiki article:
"How do I start an application after fluxbox starts"- but unfortunately that
article doesn't say what file to edit or replace. I think an edit is in
order.

With Xubuntu, there is no .xinitrc or .xsession file. Instead, the
startfluxbox script is run by the /usr/share/xsessions/fluxbox.desktop file.

To have bbpager run withdrawn a few seconds after FluxBox starts, into which
file should I be inserting statements like:

exec fluxbox &
fbpid=$!

sleep 2
{
bbpager -w &
} &

wait $fbpid

- Anybody got an idea?


Thanks for your patience.
--
- Jeff Schallenberg
Saint Lambert, Québec
Ron DuPlain
2008-07-30 11:40:06 UTC
Permalink
On Wed, Jul 30, 2008 at 7:26 AM, Jeff Schallenberg
Post by Jeff Schallenberg
I am using Fluxbox with Xubuntu 8.04.
I am trying to use the bbpager utility in the slit - it just works better
than fbpager and ipager on my little eeePC. But BBPager has the peculiarity
that it will not start until AFTER fluxbox is started.
When I was using BlackBox as a Window Manager, I was able to insert a "sleep
2 &" statement into the blackbox startup script.
So, how can I do that with FluxBox?
"How do I start an application after fluxbox starts"
- but unfortunately that article doesn't say what file to edit or replace. I
think an edit is in order.
With Xubuntu, there is no .xinitrc or .xsession file. Instead, the
startfluxbox script is run by the /usr/share/xsessions/fluxbox.desktop file.
To have bbpager run withdrawn a few seconds after FluxBox starts, into which
exec fluxbox &
fbpid=$!
sleep 2
{
bbpager -w &
} &
wait $fbpid
- Anybody got an idea?
Fluxbox startup commands usually go into $HOME/.fluxbox/startup --
where the last line is:
exec /path/to/fluxbox

Ron
--
Ron DuPlain <***@gmail.com>
http://www.linkedin.com/in/rduplain
Post by Jeff Schallenberg
Thanks for your patience.
--
- Jeff Schallenberg
Saint Lambert, Québec
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fluxbox-users mailing list
https://lists.sourceforge.net/lists/listinfo/fluxbox-users
Ron DuPlain
2008-07-30 13:12:09 UTC
Permalink
On Wed, Jul 30, 2008 at 8:10 AM, Jeff Schallenberg
Post by Ron DuPlain
Fluxbox startup commands usually go into $HOME/.fluxbox/startup --
exec /path/to/fluxbox
Yeah, Ron, I know about the startup file. It is used by startfluxbox, but it
runs those apps BEFORE Fluxbox starts. I am looking for a way to autorun an
app AFTER FluxBox starts.
Anybody?
--
- Jeff
Right, you wanted to know where you can put your code:
exec fluxbox &
# your code here ...

Based on your code example, this would go into $HOME/.fluxbox/startup --
Post by Ron DuPlain
exec /path/to/fluxbox
So to your question, "into which file should I be inserting statements
... ?" the answer is $HOME/.fluxbox/startup

The Fluxbox wiki topic is referring to this .fluxbox/startup file.
http://fluxbox-wiki.org/index.php/Howto_edit_the_startup_file

exec fluxbox &
fbpid=$!

sleep 1
{
xsetroot -cursor_name left_ptr -fg white -bg black &
ipager &
gkrellm2 &
} &

wait $fbpid

---

Does that make sense?

Ron
Rainer M Krug
2008-07-30 13:31:54 UTC
Permalink
Post by Ron DuPlain
On Wed, Jul 30, 2008 at 8:10 AM, Jeff Schallenberg
Post by Ron DuPlain
Fluxbox startup commands usually go into $HOME/.fluxbox/startup --
exec /path/to/fluxbox
Yeah, Ron, I know about the startup file. It is used by startfluxbox, but it
runs those apps BEFORE Fluxbox starts. I am looking for a way to autorun an
app AFTER FluxBox starts.
Anybody?
--
- Jeff
exec fluxbox &
# your code here ...
Based on your code example, this would go into $HOME/.fluxbox/startup --
Post by Ron DuPlain
exec /path/to/fluxbox
So to your question, "into which file should I be inserting statements
... ?" the answer is $HOME/.fluxbox/startup
The Fluxbox wiki topic is referring to this .fluxbox/startup file.
http://fluxbox-wiki.org/index.php/Howto_edit_the_startup_file
exec fluxbox &
fbpid=$!
sleep 1
{
xsetroot -cursor_name left_ptr -fg white -bg black &
ipager &
gkrellm2 &
} &
wait $fbpid
What is the story about the apps file in ~/.fluxbox? That is where I
put all my programs which I want to run after fluxbox is running,
i.e.:
[startup] {gkrellm -w}
[startup] {skype &}
.
.
.

Any advantages of using the one over the other?
Post by Ron DuPlain
---
Does that make sense?
Ron
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fluxbox-users mailing list
https://lists.sourceforge.net/lists/listinfo/fluxbox-users
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa
Ron DuPlain
2008-07-30 14:47:21 UTC
Permalink
Post by Rainer M Krug
What is the story about the apps file in ~/.fluxbox? That is where I
put all my programs which I want to run after fluxbox is running,
[startup] {gkrellm -w}
[startup] {skype &}
.
.
.
Any advantages of using the one over the other?
The apps file is cleaner for starting apps after fluxbox, in my
opinion. (Note that the apps file [startup] feature was added in
fluxbox 0.9.4.)

I was answering Jeff's question specifically with regards to the "exec
fluxbox" statement.

The easiest solution for bbpager could be to add to the apps file:
[startup] {bbpager}

Does that work for you, Jeff?

-Ron
Mathias Gumz
2008-07-30 16:21:05 UTC
Permalink
Post by Ron DuPlain
The apps file is cleaner for starting apps after fluxbox, in my
opinion. (Note that the apps file [startup] feature was added in
that is .. not true. the difference between using a script mechanism like

~/.fluxbox/startup

(or ~/.xsession or ~/.xinitrc or whatever) and a mechanism like

~/.fluxbox/apps

is, that in the first case you start the apps ONCE per xsession while
in the second case the apps mentioned in

~/.fluxbox/apps

are started every time fluxbox is started. which means: click on
"restart" in the menu (for example to restart the session during a
fluxbox upgrade) and you will have all apps mentioned in the apps file
on your screen twice (except you have closed the ones brought up in
the first round :))

additionally you can bring up apps BEFORE and AFTER fluxbox has
launched with the script based solution while you can only launch apps
AFTER fluxbox came up with the apps file based solution.

so, there is really a difference and it is not about "cleaner".

cheers,
akira
--
[uid] mathias gumz [mail] akira at fluxbox dot org [pgp] 1024D/F6F6B18C
[www] http://www.darkshed.net/ [irc] ak|ra (#fluxbox at freenode.org)
Jeff Schallenberg
2008-07-30 16:22:56 UTC
Permalink
Post by Ron DuPlain
[startup] {bbpager}
Does that work for you, Jeff?
-
Nope.

I took all the apps out of my .fluxbox/startup file, and stuck them into a
new .fluxbox/apps file:

***@eeePC:~$ cd .fluxbox
***@eeePC:~/.fluxbox$ cat apps
[startup] {conky &}
[startup] {gdesklets &}
[startup] {docker &}
[startup] {bbpager -w &}
[startup] {nm-applet &}
[startup] {wmbattery &}
[startup] {wmpinboard -w &}
[startup] {wmdrawer &}
***@eeePC:~/.fluxbox$

But, bbpager doesn't start. It needs a "sleep" statement somewhere - but,
where?
--
- Jeff
Jeff Schallenberg
2008-07-30 21:15:14 UTC
Permalink
If you have the full path to bbpager, put it in the startup script, as
{
/path/to/bbpager -w &
} &
Let me know how that works.
Ron, the full path to bbpager is /usr/bin/bbpager.
In my ~/.fluxbox/startup file, I added:

# 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
fbpid=$!

sleep 2
{
/usr/bin/bbpager -w &
} &


wait $fbpid

But that doesn't work. Should it be:

{
exec /usr/bin/bbpager -w &
} &

instead?
--
- Jeff
Ron DuPlain
2008-07-30 21:19:06 UTC
Permalink
On Wed, Jul 30, 2008 at 5:15 PM, Jeff Schallenberg
If you have the full path to bbpager, put it in the startup script, as
{
/path/to/bbpager -w &
} &
Let me know how that works.
Ron, the full path to bbpager is /usr/bin/bbpager.
# 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
Here it is. The line above should have an ampersand at the end, i.e.
exec /usr/bin/fluxbox &

(or just: /usr/bin/fluxbox &)

Without it, all of the following lines won't run until fluxbox exits.
That should do it...

Ron
fbpid=$!
sleep 2
{
/usr/bin/bbpager -w &
} &
wait $fbpid
{
exec /usr/bin/bbpager -w &
} &
instead?
--
- Jeff
Jeff Schallenberg
2008-07-30 21:28:16 UTC
Permalink
Post by Ron DuPlain
Post by Jeff Schallenberg
# 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
Here it is. The line above should have an ampersand at the end, i.e.
exec /usr/bin/fluxbox &
(or just: /usr/bin/fluxbox &)
Without it, all of the following lines won't run until fluxbox exits.
That should do it...
That did it! Thank you, Ron!
--
- Jeff
Continue reading on narkive:
Loading...