FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-04-2008, 07:36 PM
BartlebyScrivener
 
Default too many mutts

Hello,

I am on Etch and using fluxbox mainly to manage windows. I use mutt
for email. I start it with a key command.

When I get many x-sessions and programs running at once, often mutt is
running somewhere and I don't know it, so I do the mutt key command
and start a 2nd mutt, then sometimes a third.

Is there a script I could make that I could use to start mutt, and if
mutt were already running, then it could just take me to the already-
running instance of it, instead of starting a new mutt?

Thanks for any help.

I know some Python if it could be done in there. But I suspect I need
a bash script?

I didn't see a mutt option that would accomplish this.

Thank you for any help.

RD


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-04-2008, 08:38 PM
Ron Johnson
 
Default too many mutts

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/04/08 14:36, BartlebyScrivener wrote:
> Hello,
>
> I am on Etch and using fluxbox mainly to manage windows. I use mutt
> for email. I start it with a key command.
>
> When I get many x-sessions and programs running at once, often mutt is
> running somewhere and I don't know it, so I do the mutt key command
> and start a 2nd mutt, then sometimes a third.
>
> Is there a script I could make that I could use to start mutt, and if
> mutt were already running, then it could just take me to the already-
> running instance of it, instead of starting a new mutt?
>
> Thanks for any help.
>
> I know some Python if it could be done in there. But I suspect I need
> a bash script?
>
> I didn't see a mutt option that would accomplish this.
>
> Thank you for any help.

I think I'd write a bash script to grep thru ps(1) and refuse to
start a new instance if a mutt instance is already running.

- --
Ron Johnson, Jr.
Jefferson LA USA

PETA - People Eating Tasty Animals
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHp4XZS9HxQb37XmcRAmYiAKCYwtyEtXVEqQIdvnb2dF VvaAPuCQCeLMIV
K4OHiexEKJMOV9rmDHA0P3k=
=vyVz
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-04-2008, 08:50 PM
Patter
 
Default too many mutts

On Mon, 04 Feb 2008 22:00:19 +0100, BartlebyScrivener wrote:
> Is there a script I could make that I could use to start mutt, and if
> mutt were already running, then it could just take me to the already-
> running instance of it, instead of starting a new mutt?

Hacked up from a little perlish I had hanging around

my @running
`/bin/ps -aefw |/bin/grep 'perl' |/bin/grep 'mutt'|/bin/grep -v 'grep'`;
if (scalar @running > 1) {
die "mutt already running
";
} else {
system("mutt");
}

--
Stephen Patterson :: steve@patter.mine.nu :: http://patter.mine.nu/
GPG: B416F0DE :: Jabber: patter@jabber.earth.li
"Don't be silly, Minnie. Who'd be walking round these cliffs with a gas oven?"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 07:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org