Ubuntu – How to delay a startup application in Lubuntu

lubuntu

I want Firefox to start automatically when I start Lubuntu. I have the LXSession Configuration app installed. In it, I've tried entering all the suggestions in this question, such as:

bash -c "sleep 10 && firefox"

sleep 10 && firefox

xterm -e 'sleep 10 && firefox'

sh -c "sleep 10 && skype &"

For all of them, they work on the command line, but not when I enter them in the LXSession Configuration interface.

If I enter firefox by itself, it launches when Lubuntu starts.

I'm guessing all the sleep commands above only work in Ubuntu. How to I get a program to delay when autostarting in Lubuntu?

Extra note: The reason I want to delay Firefox is because I autoconnect to a VPN, and it takes a while for the VPN to complete connecting. I need Firefox to start after the VPN connection is complete, so if there is any way to force one program (like Firefox) to start upon completion of some other event (network manager completing a connection), that would work too.

Best Answer

  • Try this:

    Create a file $HOME/.config/upstart/firefox-with-delay.conf

    Content:

    start on desktop-start
    stop on desktop-end
    
    script
        sleep 30
        firefox 
    end script
    

    More info:

    http://ifdeflinux.blogspot.de/2013/04/upstart-user-sessions-in-ubuntu-raring.html

    http://upstart.ubuntu.com/

  • Related Question