Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 5876  / 3 Years ago, sun, october 10, 2021, 4:31:57

I know how to run a program on boot, on login (System > Preferences > Startup Applications) or on opening a shell (.bashrc). I also did read "execute script after desktop loaded?". What I realized that every application added to Startup Applications extends the time until the desktop becomes usable. So I'm looking for a way to start all the "nice to haves" from a script (got that working) that runs after the regular startup is finished.



I'm not fully clear how to get there. Would I use a second script that calls the first one with & (so it runs in the background) and add a wait for (a few seconds|specific event) to the first one?


More From » gnome

 Answers
1

If you're going to launch something expensive, launch it in the background with a delay. For example



after 20s find-all-the-dirty-dishes &
after 1m find ~ -name '*~' -mtime +30 -exec rm '{}' ';'


where you will have to implement after yourself but it can be something like this



#!/bin/sh
sleep "$1"
shift
exec "$@"

[#39395] Monday, October 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
allowiel

Total Points: 189
Total Questions: 103
Total Answers: 105

Location: Slovenia
Member since Thu, Mar 18, 2021
3 Years ago
;