Re: FVWM: FvwmButtons' "hangon"

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Sat, 30 Jun 2001 15:12:56 +0000

On 29 Jun 2001 19:02:46 -0400, Dan Espen wrote:
>
> "Tim Freedom" <tim_freedom_at_hotmail.com> writes:
> >
> > I have the following in my .fvwm2rc file
> >
> > AddToFunc ToggleNetscape
> > + "I" None (Netscape*) Exec exec netscape
> > + "I" Next (Netscape*) Focus
> >
> > # Define the buttons to use.....
> > *FvwmButtons Netscape netscape.xpm ToggleNetscape
> >
> > Where do I insert this "hangon" (in between the Exec & exec) to get
> > the desired affect (please give examples) ???
> >
> > I'm using fvwm-2.3.33
>
> I don't believe you can do what you are trying.
>
> Based on the man page, "hangon" works in 3 different contexts,
> Swallow, Panel, and Exec. But thats "Exec" when interpreted by
> FvwmButtons, not within a function started by FvwmButtons.
>
> I suppose you could start Netscape as a slide out panel,
> that would be:
>
> *FvwmButtons (Panel (up) Netscape ToggleNetscape)
>
> WARNING, none of this is tested, and I'm not much of an
> FvwmButtons expert.

This is not an acceptable solution, because:

  * FvwmButtons subpanel is started together with FvwmButtons and is
    hidden until expanded, probably not what Tim wants
  * The possition of subpanel is fixed, you may resize it, but not move
    (the posision is reevaluated after collapsing/expanding)
  * Netscape is not something one estetically wants to put into panel

Here is a solution that works in the latest 2.3.x:

  Style Netscape GrabFocus
  *FvwmButtons: (Icon netscape.xpm, Action `Exec "netscape" exec netscape`)
                                               # ^^^^^^^^^^ <- "hangon"

And optionally you may write bin/netscape wrapper like the one I use:

#-----------8<-----------cut here-----------8<-----------
#!/bin/tcsh -f
#
# Start a new netscape program if not already lanched, otherwise add
# a new window (optionally with the specified url) to the existing one.
# Tested with Netscape 3, but should work with Netscape 4 too.
#
# Usage is like for the original netscape: netscape [url] [other-options]

set NETSCAPE = /usr/bin/netscape
set lock = $HOME/.netscape/lock

set OPTIONS=($*:q) # preserve all original quotes/spaces
if (-l $lock) then
        # remove any stale lock (useful if netscape crashed)
        if (`ps x | grep '[n]etscape ' | wc -l` <= 1) rm $lock
        if ($#OPTIONS == 0 || $OPTIONS[$#OPTIONS]:q =~ [-,+,0-9]*) set OPTIONS=($OPTIONS:q "")
        _at_ opt_1 = $#OPTIONS - 1
        # don't add -remote if already specified
        if (-l $lock && "$OPTIONS" !~ *-remote*) set OPTIONS=($OPTIONS[1-$opt_1]:q '-remote' 'openURL('$OPTIONS[$#OPTIONS]:q',new-window);')
endif

$NETSCAPE $OPTIONS:q
#-----------8<-----------cut here-----------8<-----------

Regards,
Mikhael.
--
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 Sat Jun 30 2001 - 14:32:24 BST

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