Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 11-29-2006, 04:13 PM   #1
Registered: Dec 2002
Location: UK
Distribution: Slackware 12; Ubuntu 7.10
Posts: 358

Rep: Reputation: 31
kontact startup script - check if started


I use bash, could someone help with a script to check if kontact is started and if not start it. With KDE I have kontact in Autostart folder, however if the session-restart starts kontact then I get two copies of the program running which always causes problems. I'd prefer kontact to start with the kmail view.

So far I have :

# script to start kontact only if it's not running
if ! [ "ps x | grep -i -e ".*kontact$"" ] ; then
echo "kontact_start: Kontact started now."

Old 11-29-2006, 04:51 PM   #2
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
You could ask dcop:
if dcop kontact > /dev/null 2>&1; then
    echo "kontact is running"
    echo "kontact is not running"
Note that not all programs use dcop. Most KDE apps do, but not much else.
Old 12-04-2006, 04:41 PM   #3
Registered: Dec 2002
Location: UK
Distribution: Slackware 12; Ubuntu 7.10
Posts: 358

Original Poster
Rep: Reputation: 31
Having been using this script for about 4 days I can safely say it kinda works.

That is it's better now. But I still get some crashes. I think perhaps the mechanism (whatever that may be) for restarting KDE sessions takes some time to reset the desktop to its previous state. Sometimes, I suspect, Kontact hasn't started by hte time this script (in Autostart) runs, and sometime it has and kontact crashes through a kmail self-conflict.

So thanks. But it's still not completely fixed it.

I guess I could try adding some wait() in there?

Last edited by pbhj; 12-04-2006 at 04:43 PM.


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
X screwey on startup, fine after killed & started again 95se Linux - Laptop and Netbook 0 11-18-2006 01:27 PM
I have started working on a tutorial script kedens Linux - General 6 10-15-2006 05:48 PM
Kontact gives error on startup unholy Mandriva 0 12-18-2004 02:00 PM
KDE edit programs automatically started on startup qwijibow Linux - Newbie 2 08-20-2003 09:23 PM
How Do I Have a script started at boot time? Chijtska Linux - General 12 03-18-2002 06:41 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:42 AM.

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