Subject: FVWM: conditional functios

From: Linux-Debian Team <[email-masked]>
Date: Sun, 17 Aug 1997 11:18:05 +0200

I am used to open a note pad from time to time, anywhere in my
workplace. My note pad is a plain text file edited through vi in
xterm and i can pop it up either by key composition or selecting
a menu item in fvwm2 root context.
Often it happens i try to open my notes file twice simultaneously,
having forgotten a vi session is already active on another desktop
of my workplace.
Here my question follows: is there a viable solution in order to
avoid opening twice the sape file?

A further question comes to my mind: 
May it be possible to apply a condition to the execution of a command
in fvwm2 ? In affirmative case, the window manager could be asked
to execute a script file; then, depending on the result, to start
one function or another.  In the present case, the script would
check whether the requested (my notes) file is already open.

thank you 

Paolo Pumilia

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked]
Date: Sun, 17 Aug 1997 12:03:35 -0400 (EDT)

Paulo--

I have a window-manager-independent solution to this problem, called
`xcmd'.  Here's the LSM entry:

Begin3
Title:          xcmd
Version:        1.5
Entered-date:   11AUG97
Description:    Xcmd is a front-end for starting programs under X11.
                You can tell xcmd to look for a window with a specific
                class, resource name, or title string (using the
                `--find-<property>' options); if it finds one or more,
                xcmd will `raise' them, otherwise it will run the
                command you specify. You can tell xcmd to run commands
                that create their own windows (using `--xcmd'), or to
                run commands inside a terminal window (using `--cmd')
                with various options.
Keywords:       X11, xterm, rxvt, command, utility, xwit, xwininfo
Author:         Jim Knoble <[email-masked]>
Maintained-by:  Jim Knoble <[email-masked]>
Primary-site:   sunsite.unc.edu /pub/Linux/X11/xutils
                16kB xcmd-1.5.tar.gz
Alternate-site: 
Original-site:  
Platforms:      X11R6
Copying-policy: GPL
End

--jim

############### jim knoble ######## [email-masked] #################

On Sun, 17 Aug 1997, Linux-Debian Team wrote:

: I am used to open a note pad from time to time, anywhere in my
: workplace. My note pad is a plain text file edited through vi in
: xterm and i can pop it up either by key composition or selecting
: a menu item in fvwm2 root context.
: Often it happens i try to open my notes file twice simultaneously,
: having forgotten a vi session is already active on another desktop
: of my workplace.
: Here my question follows: is there a viable solution in order to
: avoid opening twice the sape file?
: 
: A further question comes to my mind: 
: May it be possible to apply a condition to the execution of a command
: in fvwm2 ? In affirmative case, the window manager could be asked
: to execute a script file; then, depending on the result, to start
: one function or another.  In the present case, the script would
: check whether the requested (my notes) file is already open.
: 
: thank you 
: 
: Paolo Pumilia

---

From: Michael Tiefenback <[email-masked]>
Date: Sun, 17 Aug 1997 14:43:20 -0400 (EDT)

On Sun, 17 Aug 1997, Linux-Debian Team wrote:

> Subject: FVWM: conditional functios 
> 

I have seen examples posted to this list of fvwm2 functions referencing
the existence of a window of a particular name, popping it up and warping
to it if it exists.  If it does not exist, then create it in the usual
way.  I think the primary objects of interest were web browsers and mail
clients.  I use my FvwmPager with color- and name-coding to serve this
function.  I will try to find any references to this mechanism that I may
have archived.

> check whether the requested (my notes) file is already open.

Others have responded already to this.  As mentioned, lock files are
reasonable as a mechanism.  But they are not as reliable as the window
existence unless the lock file contains a PID number which can be polled
by ps for its current existence.  I use this mechanism for certain
controls processes here at work, so that stale lock files can be
automatically cleared.

Michael Tiefenback

---

From: aesop <[email-masked]>
Date: Sun, 17 Aug 1997 15:01:47 -0400 (EDT)

> avoid opening twice the sape file?
snip
> Paolo Pumilia

This solution was posted a while back.  I find it very useful.  Give
credit to lar3ry

<original>
AddToFunc       "warp-or-run"
+       "I"     Next [$0] Iconify -1
+       "I"     Next [$0] Focus
+       "I"     None [$0] $1 $2 $3 $4 $5 $6 $7 $8 $9

The first argument ($0) is the name of the window to search for.  The
next arguments (up to 9) are the 'Exec' command to run if the window
isn't found.

Using the new FvwmButons module, you can call it as such:

*FvwmButtons(Icon mini-filemgr.xpm, Action 'warp-or-run "moxfm*" Exec
moxfm')

-- 
------------------ http://www.tiac.net/users/lar3ry/ -------------------
(void) lar3ry();                                      [email-masked]
</original> 

Eric

Dogbert: Has your electronic mail system made you more efficient?
Dilbert: In a way... Now I'm getting ignored at the speed of light.
						-- Scott Adams