pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-users] Wish: don't start a new instance of pan.


From: Wolf J. Flywheel
Subject: Re: [Pan-users] Wish: don't start a new instance of pan.
Date: Fri, 12 Sep 2003 20:00:25 -0400
User-agent: KMail/1.5.3

On Friday 12 September 2003 17:30, Toby A Inkster wrote:

> Often I will have Pan running on localhost:1 (Xvnc) and forget about it
> and start Pan up on localhost:0. Oh no! My read messages are marked
> unread again!

        Forget VNC -- I've done it just by having Pan minimized or in another 
workspace!  :)

> There should be an option to make Pan refuse to start a second instance
> under the same user name. It should pop up a window with an explanation
> though.

        Yes, this would be cool!  However, you can easily simulate it by using 
a 
one-line Bash command such as:

if (pidof pan); then xmessage "Hey!  Pan's already running!"; else pan; fi

        You could run that instead of just "pan" by editing your menus, 
assuming 
you run in a GUI environment (since you use VNC).  I haven't tried doing 
that, but it should work... if necessary you could put it in a file and 
make the first line "#!/bin/bash", then point your menu item to that.
        BTW, I am *not* an expert on Bash command syntax, but that works here 
(in 
a command window) to pop up a very ugly message window if the program 
"pan" is already running.  There are, no doubt, better ways to do that, 
but it does, at the least, work.

        Hm, just before sending, I had another thought, and there *is* a better 
way if you don't need a pop-up message:

pidof pan || pan &

        From a command line, that will start pan if and only if "pidof pan" 
returns false.  It should be easy enough to incorporate into a menu item 
or a shell alias.  In fact, I think I'll do so here!  :)

-- 
// Carl Hudkins :: Jabber address@hidden :: PGP 50238D9E
//
// "German beer is chemical-free / Germany's all right with me!"
//                                --"Why Aye Man", Mark Knopfler

Attachment: pgpfKPY_CHwwP.pgp
Description: signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]