LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-05-2013, 03:19 PM   #1
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 133

Rep: Reputation: 18
Controlling startup programs and defer loading


Is there a way to delay loading of certain programs on startup, particularly in KDE?

By what I mean is, I have steam, ktorrent, davmail, amarok, akregator, telepathy, kmail, chrome, opera opening on startup. Is there a way to prioritise in that I can get going with working while things like steam, ktorrent, telepathy etc start after I've gotten to a usable desktop?

The only thing I've thought of is adding
Code:
sleep
to specific .desktop files.
 
Old 05-05-2013, 07:57 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
I don't know how you'd do that from the GUI, but the general principle would be to add an ampersand '&' at the end of the cmd line eg
Code:
/path/to/prog &
This causes it the program to run in the background, thus not waiting on it.
I assume there is a way to edit the cmd invocation.
 
Old 05-05-2013, 08:26 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,707

Rep: Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270
One way you can do this uses the "auto start" feature most desktops have.

What you do is create a script with something like:
Code:
#!/bin/bash

sleep 15
app1&
app2&
...
You can even put a few added sleeps if you think your CPU is getting overloaded by starting too many things at once.
 
Old 05-05-2013, 09:33 PM   #4
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 133

Original Poster
Rep: Reputation: 18
Thanks for the help.

So it doesn't seem there is a GUI program for this, so should I be starting these delayed apps via .xinitrc?
 
Old 05-05-2013, 10:02 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,707

Rep: Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270
Quote:
Originally Posted by BeaverusIV View Post
Thanks for the help.

So it doesn't seem there is a GUI program for this, so should I be starting these delayed apps via .xinitrc?
Not easily, but it can be done.

The problem with .xinitrc is that it isn't usually used for desktop environments. You can, but you get to copy whatever it is that is used to start the particular environment... and sometimes that is a binary and not a script. The issue is that what is started in the desktop is a lot of applications already, and USUALLY (not always) the last thing started is the window manager.

I say USUALLY because one configuration I worked with didn't - what it had instead was listener process waiting for a "LOGOUT" entry to be applied to the X resource database. When it saw that it would exit. Presumably, most of the other processes in the desktop environment would also exit (it was up to the toolkit). This allowed the applications to have a graceful termination (allowing them to save state) before being terminated.

That was why I referred to the "auto-start" features KDE, Gnome, LXDE, (and others) have.
 
Old 05-05-2013, 10:44 PM   #6
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 133

Original Poster
Rep: Reputation: 18
Well, I know my DE is started using .xinitrc, but I get ya.

For KDE I would put a script in .kde4/Autostart that replaces the .desktops I have in there currently.

Does anyone know how you could resume sessions for these apps? i.e. stop KDE loading your previous session for that program and then use that session in the delayed start?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling kernel device loading order? katayamma Linux - General 1 06-20-2006 09:57 PM
loading CLI programs in X at startup edM Slackware 3 10-20-2005 09:29 PM
loading programs at startup MR_UNO Linux - Software 1 01-28-2005 11:17 PM
Controlling System Startup with rc.d Cikotic *BSD 10 06-24-2004 05:55 PM
unwanted programs loading on startup shamrock_uk Mandriva 1 12-01-2003 04:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration