Results 1 to 4 of 4

Thread: how do I put a delay on autostart programs?

  1. #1
    Join Date
    Aug 2015
    Beans
    582

    how do I put a delay on autostart programs?

    I'm running Lubuntu 18.04.

    I placed Software Updater within /.config/autostart/ so every time I booted my machine, Software Updater would start and update my system, but I'm getting a problem at startup though, there seems to be a 10 second delay on connecting to my WIFI and so Software Updater would fail, making me click on try again when the WIFI is connected.

    So, I'd like to put a 15 second delay on Software Updater autostarting, how can I do this?

    Thanks.

  2. #2
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: how do I put a delay on autostart programs?

    I do not use Lubuntu and have forgotten all I knew back when I tried it, but you probably need to change the command used in the autostart system to something similar to sleep 15; update-manager, using whatever the updater command really is.

  3. #3
    Join Date
    Feb 2015
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: how do I put a delay on autostart programs?

    Quote Originally Posted by ardouronerous View Post
    ....

    So, I'd like to put a 15 second delay on Software Updater autostarting, how can I do this?

    Thanks.
    Write a simple bash script and store it in your home folder, eg in /home/$USER/bin/. Give it a name you can then use in the ~/.config/autostart file.
    In that script include a 15 second sleep command then the command to initiate the software updater.

    As an example I use Xubuntu 18.04 and in the startup list I have an entry that calls a script in my $HOME/bin folder called "DPMS_OFF-startup". This script shown in the next code box uses a 20 second delay on startup then it turns off all DPMS settings so I have no screen blanking or monitor turning off occurring in the new session.
    Code:
    #!/bin/bash
    
    sleep 20 && \
    xset s 0 0; xset s noblank; xset dpms 0 0 0; xset -dpms;
    
    exit 0
    I don't know the exact command you use with the software updater but changing the above script to 15 seconds and replacing the xset commands line above to that for the software updater should work for you. Whatever you call the script is what you call with the autostart file entry. The location $HOME/bin should be in your users system path so this idea should work ok for your needs.

    Regards, yeti.

    Edit: ninja'd by ajgreeny
    Last edited by yetimon_64; June 13th, 2019 at 01:48 PM. Reason: ninja'd

  4. #4
    Join Date
    Aug 2015
    Beans
    582

    Re: how do I put a delay on autostart programs?

    Hi, after searching the forums further, I've found this solution: https://ubuntuforums.org/showthread....4#post13502344

    Code:
    Exec=sh -c "sleep 15 && /usr/bin/update-manager"
    It works!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •