LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-24-2003, 09:29 AM   #1
stevenhasty
Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Slackware-current
Posts: 169

Rep: Reputation: 30
limit program to one instance


I use evolution for mail. Sometimes, I forget it's already running and start it again, and it opens with the same profile, so it starts crashing. How can I limit evolution to only running one instance at a time (and possibly switching to that window if it's already running)? I'm not very good at shell scripting, so any help would be appreciated. If it doesn't require a shell script, that would be fine, too.
 
Old 10-24-2003, 01:37 PM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
This should do it, note there's no #!/bin/bash on purpose

Change /usr/bin/evolution-1.4 for whatever the full path is to start evolution/version on your system,

Code:
if ! /sbin/pidof /usr/bin/evolution-1.4
then
   /usr/bin/evolution-1.4
fi
Just create and launcher on your desktop to run whatever file you saved the above in, or edit what currently starts evolution

Second thoughts only works if you start it as a desktop launcer (talking gnome here) and not properly if you alter the menu item, but it's a start

Last edited by Looking_Lost; 10-24-2003 at 01:48 PM.
 
Old 10-28-2003, 04:38 PM   #3
stevenhasty
Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Slackware-current
Posts: 169

Original Poster
Rep: Reputation: 30
Great, that worked. It's not perfect, but it will do for now. It still makes the gnome 'busy' cursor when I try to make a second instance with the launcher (which was making it crash before), but it seems not to crash now. Next, if possible, I want to find out how to make it switch to the evolution window if it's already running.
 
  


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
restricting multiple instance of a program V_Ganesh Programming 14 01-23-2008 10:42 AM
How to limit the bouncy icon time when opening a program blastradius Ubuntu 4 11-02-2005 01:07 AM
how to limit the cpu power a program gets? learnmelinux Linux - General 4 04-21-2005 05:34 AM
Passing parameters to already running instance of a program saravkrish Programming 5 10-31-2004 02:19 PM
How to find instance of a program mayankjohri Programming 4 12-09-2002 11:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:20 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
Open Source Consulting | Domain Registration