Request: Add startup delay to startup applications

Please add startup delay setting to startup applications like in Linux Mint distros:
http://a.disquscdn.com/uploads/mediaembed/images/1030/4704/original.jpg

6 Likes

That’s actually a nice idea

I'll join myself to that request! This is particularly useful, since some applications don't play nice if not slightly delayed. It's also very useful if we which for some application to be executed only after another.

In the meantime, in case you don't know how, you can do this yourself. The way I have it setup myself is a script that launches those applications and then I simply call the script from the Startup Applications program.

The script goes like this and I believe you can follow it with your own entries. The sleep commands are what controls the delay.

#!/usr/bin/env bash

# 5s, tilda, artha
sleep 5s
/usr/lib/ubuntu-mate/ubuntu-mate-tilda
artha

# 15s, conky
sleep 10s
conky -dc "/home/marfig/.conky/time"
conky -dc "/home/marfig/.conky/sys"
conky -dc "/home/marfig/.conky/mpd"

(Strictly speaking, artha doesn't require a delay. Tilda does require a delay on my machine when using transparency with the Marco (Software) window manager. And Conky also definitely only behaves nicely if its startup is delayed.)

I name this script startup and place it on my home folder bin, at /home/marfig/bin
Then I just add a new entry to the Startup Applications:

1 Like

Alternatively, you can define your own sleep setting with sh;
sh -c "sleep [time] && [app] --[arg1] --[arg2] '[arg2stuff]'" and so on.

But yeah, it seems like a good idea. I might experiment with trying to add this into Ubuntu MATE by ripping it from Linux Mint later.

1 Like

I have experimented with various approaches to the sleep command, from simply adding it into the command field in each individual startup dialog box for each application to having a single bash script for all of the applications I want to be delayed to, finally, having individual bash scripts for each application that are each listed separately in my startup applications list. In my own experience, I have found the last of these three is the most reliable. Including them as an appendix to the command in the startup dialog box just seems to be unreliable. Having them all in one bash script is good and works. Until it doesn’t. At which point, all of the applications lists in the one file fail to load. By having them as all separate bash scripts, I can micro manage each one.

1 Like

Delays are often needed so I’ll give it a thumbs up. But as @stevecook172001 already mentioned, I use a single startup script these days.

A novel approach, but then I don’t see what the sleep time is for each application. I found that using sleep just works fine for me where I need to use it at the moment. I suppose, the system running sleep fifteen times in a row tends to have unintended consequences, but I never felt I needed to do that yet.

I won’t even begin to guess how cinnamon-settings handles this, but it could very well be done with sed as an inelegant, hacky way of doing it for MATE.

Start-up Applications = mate-session-properties

Someone should create a feature request to ask the MATE developers upstream:

2 Likes

I also entertained the idea of individual startup scripts. I ran a test once of 100 individual scripts running sleep 5 and outputting to a log file. Like @tiox mentioned, I was worried about any side-effects of concurrent sleep commands. But the results were fine. No doubt sleep not being a shell built-in command helps.

But in the end I decided for the single script above on which all delayed applications startup is managed. After all, the principle isn’t any different from how X and MATE do it with any startup applications, which also reside on a single configuration file. And the shell guarantees that if one command fails, the others will still execute.


EDIT:
As suggested by @lah7, I added the feature request. We can discuss it at:

3 Likes

This is how mint does it

Conky does need a delayed start
but conky command already has a pause option:

[quote=“man conky”] -p | --pause= SECONDS
Time to pause/wait before actually starting Conky.
[/quote]