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

fvwm: implementing dynamic Debian menus (was: Re: Bug#90867: Menu is more important than it would seem)



Package: fvwm
Version: 2.2.5-1
Severity: wishlist

On Wed, Mar 28, 2001 at 01:45:15AM -0800, Erik Steffl wrote:
>   fvwm supports dynamic menus, there are examples of having e.g. content
> of a directory as a submenu etc... it's just that current fvwm package
> is designed so that the menu is read once in the beginning. nothing
> prevents us (somebody:-) to change it so that menu definition is
> periodically checked or that update-menu does something that causes fvwm
> to reread the menu... (this might get messy, I guess it could get
> implemented by menu methods...)

So I guess something like this would do it:

At every request for Debian menu, instead of doing a Popup /Debian, we
would do:
  PipeRead fvwm2-refresh-menu popup

and fvwm2-refresh-menu would be something like:

--------
#!/bin/sh

if [ ! -e $HOME/.fvwm.debian-menu ] || \
  [ /etc/X11/fvwm/menudefs.hook -nt $HOME/.fvwm.debian-menu ]
then
    cat /etc/X11/fvwm/menudefs.hook
    cat <<EOF
# Add in user additions
Read /etc/X11/fvwm/main-menu.hook Quiet
Read .fvwm/main-menu.hook Quiet

# Tack a quit entry on to the end; this version uses a pop-up menu to ask
# the user to confirm, MWM-style (?).  The second line may be changed as
# indicated to use a popup form instead.  (The QuitVerify form is defined
# in system.warnings, read in later.)
AddToMenu /Debian
+  ""            Nop
+  "Exit Fvwm"   Popup Quit-Verify
EOF

    touch $HOME/.fvwm.debian-menu
fi
if [ "$1" = "popup" ]; then echo "Popup /Debian"; fi

exit 0
--------

Then if a user wants to pre-initialise his Debian menus, he can place
a PipeRead command in ~/.fvwm/init-restart.hook.  (This would close a
bug open against the fvwm package.)

This won't work for fvwm1, though (doesn't have a (Pipe)Read
command).

   Julian

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

         Julian Gilbey, Dept of Maths, Queen Mary, Univ. of London
       Debian GNU/Linux Developer,  see http://people.debian.org/~jdg
  Donate free food to the world's hungry: see http://www.thehungersite.com/



Reply to: