Re: FVWM: Function to conditionally popup a window

From: stu <swl_at_ucs.co.za>
Date: Thu, 27 May 2004 12:49:50 +0200

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

On Wed, 26 May 2004 14:10:43 -0400
Phil Stracchino <alaric_at_caerllewys.net> wrote:

> On Wed, May 26, 2004 at 02:24:19PM +0200, stu wrote:
> > Hi everyone
> >
> > I have an app - multi-gnome-terminal - that can be started up in two
> > modes - 'factory' or 'client'. I want the first instance started of
> > this app to always be the 'factory', and all other instances to be
> > the'clients' ( doing it this way reduces memory usage ).
> >
> > Unfortunately, this app is not intuitive enough to start a 'factory'
> > if one doesn't exist, and to connect to one if it does, with the
> > same command. Therefore I need to write a function to invoke this
> > app that checks if the 'factory' is running, and invokes it if it is
> > not, and invokes the 'client' if the factory is running ie
> >
> > if (an instance of multi-gnome-terminal is running)
> > # Start client
> > Exec exec multi-gnome-terminal --use-factory
> > else
> > # Start factory
> > Exec exec multi-gnome-terminal --start-factory-server
> > fi
>
>
> Have you considered using a wrapper script? This is what I do with
> Mozilla. If there is no Mozilla process running, my wrapper launches
> Mozilla; if Mozilla is already running, then the wrapper sends a
> command to the running Mozilla process using the -remote interface to
> perform the requested action.

I did try that. Didn't succeed but was getting there before I adopted
this solution below, provided by Tavis :

AddToFunc StartMgt
+ I Any (MGT*) Exec exec multi-gnome-terminal --use-factory
+ I TestRc (NoMatch) Exec exec multi-gnome-terminal \
                                           --start-factory-server

This works very well BUT, *blush* I have since discovered that if one
starts MGT like this :

multi-gnome-terminal --start-factory-server --use-factory

it IS intuitive enough to figure out what to do. Pity the man page
makes this fact as obscure as possible without hiding it completely.

Still, a good fvwm learning experience once again :)

- --
Stuart Logie
Programmer

UNIVERSAL COMPUTER SERVICES (PTY) LTD
   
Powered by Debian GNU/Linux - testing/unstable

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQCVAwUBQLXHzuuEbVzzghHCAQIwrwP+NzKlx7j3cI/tpJ/E3LT5u2TUYH3ZSerq
nWHAzrTlYd7w3qMFo0aZgJMTrdfehcHjbwtsjXAWGWMRzMAZOOqVwu5KCxFlTkkh
hUHl0YiqN3lcM5Y+7H/WkW8odV4G6ZFfEjfnbym4Q9GkHu4JbcrdpuTl31X0dXp2
z0z3ZsYnWSU=
=bM0X
-----END PGP SIGNATURE-----
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Thu May 27 2004 - 05:53:53 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:56 BST