You are not logged in.

#1 2013-01-11 19:43:35

patofet
Member
Registered: 2013-01-03
Posts: 15

[SOLVED]How to start an application when system has just started?

Hi, I have problems to start Thunderbird and volumeicon, Thunderbird say "Thunderbird is already running, but is not responding"(and Thunderbird is NOT already running it's impossible) and volumeicon doesn't appear and "special" keys(+ vol, - vol and mute) doesn't work. I think that it happen because Thunderbird and volumeicon start before x11 and pulseaudio(or something like that) and it doesn't work very well, someone know how to fix it? or how to start an application when system has just started?

I use:
-Xfce
-I have an automatic terminal log in with this ans automatic start X at login with this
and my ~/.xinitrc:
#!/bin/sh
if [-d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi

exec startxfce4
-For start my aplications I use  automatic startup in Sessions and Startup in Settings Manager.
-For start this programas I go Settings Manager → Sessions and Startup → automatic startup (my translation)
And I add:
volumeicon (for volumeicon)
thunderbird (for thunderbird)



Thanks ^^

Last edited by patofet (2013-01-27 11:26:27)


Sorry for my bad english, I'm not english native tongue

Offline

#2 2013-01-11 19:48:06

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,565
Website

Re: [SOLVED]How to start an application when system has just started?

Welcome to the boards.

Please read How To Ask Questions The Smart Way; your posts lacks any helpful information, like:

  • Your environment/wm

  • How you start X

  • What you are using to autostart programs

  • How you are trying to start these particular applications

In short, it is impossible to provide advice when your problem is not clearly defined, or really defined at all...


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#3 2013-01-11 20:05:41

patofet
Member
Registered: 2013-01-03
Posts: 15

Re: [SOLVED]How to start an application when system has just started?

jasonwryan wrote:

Welcome to the boards.

Please read How To Ask Questions The Smart Way; your posts lacks any helpful information, like:

  • Your environment/wm

  • How you start X

  • What you are using to autostart programs

  • How you are trying to start these particular applications

In short, it is impossible to provide advice when your problem is not clearly defined, or really defined at all...

Yes ... sorry now its correct I think ...


Sorry for my bad english, I'm not english native tongue

Offline

#4 2013-01-11 20:48:37

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: [SOLVED]How to start an application when system has just started?

Create script(s) that first waits before launching the program like:

#!/bin/sh
(sleep 10s && thunderbird) &

Then add that script to your startup. You can adjust the delay as necessary.

Offline

#5 2013-01-11 22:56:35

patofet
Member
Registered: 2013-01-03
Posts: 15

Re: [SOLVED]How to start an application when system has just started?

anonymous_user wrote:

Create script(s) that first waits before launching the program like:

#!/bin/sh
(sleep 10s && thunderbird) &

Then add that script to your startup. You can adjust the delay as necessary.

Thanks for your solution but I want a better solution, something like a while looking for some process or configure some think that execute some sh file


Sorry for my bad english, I'm not english native tongue

Offline

#6 2013-01-12 00:07:07

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,565
Website

Re: [SOLVED]How to start an application when system has just started?

patofet wrote:

Hi, I have problems to start Thunderbird and volumeicon, Thunderbird say "Thunderbird is already running, but is not responding"(and Thunderbird is NOT already running it's impossible)

This doesn't make sense. You would only get the Thunderbird error message if you manually tried to start TB while your autostart script was loading it. Either that, or you have it configured to autostart in two separate places.

In any case, anonymous_user's suggestion is about as elegant as it gets. You could extend it slightly by having a single shell script sleep and then do the autostarting for you, but that is a minor variation on the same theme.

If you do want a better solution, please try and express the functionality more clearly. Just saying that someone's proposed solution is not good enough without any concrete reasons why comes across as a little bit rude.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#7 2013-01-12 10:26:42

patofet
Member
Registered: 2013-01-03
Posts: 15

Re: [SOLVED]How to start an application when system has just started?

jasonwryan wrote:
patofet wrote:

Hi, I have problems to start Thunderbird and volumeicon, Thunderbird say "Thunderbird is already running, but is not responding"(and Thunderbird is NOT already running it's impossible)

This doesn't make sense. You would only get the Thunderbird error message if you manually tried to start TB while your autostart script was loading it. Either that, or you have it configured to autostart in two separate places.

In any case, anonymous_user's suggestion is about as elegant as it gets. You could extend it slightly by having a single shell script sleep and then do the autostarting for you, but that is a minor variation on the same theme.

If you do want a better solution, please try and express the functionality more clearly. Just saying that someone's proposed solution is not good enough without any concrete reasons why comes across as a little bit rude.

No, I only have one because if I quit TB from startup list it doesn't start.

The anonymous_user's suggestion yes it work but if I have a very slow computer and it takes over 10s or in the another way if I have a super computer and only takes 1s it will start too late(I think) I want a shell script that detect that a x11 and pulseaudio it's finished to start(or something like that).

I'm sorry, english is not my native language it's not my intention to be a rude U.U

Last edited by patofet (2013-01-12 10:37:40)


Sorry for my bad english, I'm not english native tongue

Offline

#8 2013-01-12 10:35:38

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,644
Website

Re: [SOLVED]How to start an application when system has just started?

Can't this be done with user service files? I haven't done it myself so I do not know exactly how, but I would expect that  you could use oneshot services with the "Wants" or "Requires" options to order them after your session has started.

Offline

#9 2013-01-12 16:25:13

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: [SOLVED]How to start an application when system has just started?

The wiki has a section on writing service files:

https://wiki.archlinux.org/index.php/Sy … vice_files

Offline

#10 2013-01-27 11:25:52

patofet
Member
Registered: 2013-01-03
Posts: 15

Re: [SOLVED]How to start an application when system has just started?

Thanks a lot ^^, I found a solution, I create this two scripts and I add these in startup:
For volumeicon:
#!/bin/bash
volumeicon;
while [ $? -ne 0 ]
do
    volumeicon;
done
And for thunderbird:
#!/bin/bash
i=`ps -aux | grep volumeicon | wc -l`;
echo $i;
while [ $i -ne 2 ]
do
    i=`ps -aux | grep volumeicon | wc -l`;
done
thunderbird;

and now it's work ^^


Sorry for my bad english, I'm not english native tongue

Offline

Board footer

Powered by FluxBB