I want to create some Submenus “on-the-fly” with “MissingSubmenuFunction”
So i created 3 Functions, they create this three Submenus. It works.
BUT
I can use only one MissingSubmenuFunction per each menu. I have a Submenu “Windowmanager”, an in this Submenu i want to have one Menu from which i can choose a Wallpaper, the Fvwm-Manpages and the Fvwm-Modules. And i want to create this Submenus from the current content.
If i put into the “Windowmanger”-Submenu three times “MissingSubmenuFunktion”, only the last one workes. And i have no idea, ho to make a branch to the 3 functions with the test-command in case of the given directory-path, the content of $0…
The Submenu “Windowmanager”:
[code]DestroyMenu THISWM_MENU_popup
AddToMenu THISWM_MENU_popup “WindowManager” Title
- MissingSubmenuFunction WM_MENU_FUNC
#+ MissingSubmenuFunction WallpaperBrowser - Wallpaper Popup “/home/jakob/Wallpaper”
- “” Nop
#+ MissingSubmenuFunction ModuleBrowser
- “” Nop
- “Module” Popup “$[FVWM_MODULEDIR]”
#+ MissingSubmenuFunction ManpageBrowser - “Fvwm-Manpages-dynamic” Popup “/usr/share/man/man1”
- “Fvwm-Manpages” Popup manpages_popup
- “” Nop
- “Fvwm2-Manpage” Exec xterm -e man fvwm
- “” Nop
- “Restart Fvwm2” Restart
- “” Nop
- “Exit” Quit
[/code]
And the three (4) functions
[code]#####
Example: http://dev.gentoo.org/~taviso/screenshots/may04a-fvwm.png
Remember, fvwm-root only works with png and xpm, if you use lots of jpg, try changing this
to Esetroot, or similar.
If you have xv installed, clicking the title will start a slide show.
###############
DestroyFunc WallpaperBrowser
AddToFunc WallpaperBrowser I PipeRead ‘test ! -d “$0/.thumbs” && mkdir “$0/.thumbs”;
for i in “$0/”; do
test -f "$0/.thumbs/${i##/}"
-a “${i}” -ot “$0/.thumbs/${i##/}" || {
convert -quality 0 -scale 42 “${i}” "png:$0/.thumbs/${i##/}” 2>/dev/null
|| continue;
};
done;
fvwm-menu-directory --icon-title folder_view.png --icon-file PIXMAP
–icon-dir folder_paper_closed.png --dir “$0” --exec-file “^$[fvwm_wallpapersetter]”
–exec-t="^xv -wait 2 " | sed -e “s#FuncFvwmMenuDirectory#WallpaperBrowser#g”
-e "s#PIXMAP\(.\)\"\(./\)\(.\)\"#\2.thumbs/\3\1\2\3#g"’
[/code]
[code]##############################################################################
>>> MODULE
##############################################################################
(jakob´s config)
DestroyFunc ModuleBrowser
AddToFunc ModuleBrowser I PipeRead ‘fvwm-menu-directory --icon-title folder_view.png --icon-dir folder_paper_closed.png
–dir $[FVWM_MODULEDIR] --title “” --exec-file “^Module” |
sed -e “s#Exec xterm -e##g” -e “s#$[FVWM_MODULEDIR]/##g” -e “s#Fvwm##1” -e “s#\”##3" -e “s#\”##3"’
[/code]
[code]##############################################################################
>>> MANPAGES
##############################################################################
(jakob´s config)
DestroyFunc ManpageBrowser
AddToFunc ManpageBrowser I PipeRead 'fvwm-menu-directory --icon-title folder_view.png --icon-dir folder_paper_closed.png
–dir “/usr/share/man/man1” --title “” --exec-file “^xterm -e man” |
grep “^Destroy\|^AddTo\|^+ Dynamic\|^+ Missing\|^+ \“Fvwm*”|sed -e “s#\.1\.gz##g” -e “s#/usr/share/man/man1/##g” -e “s#\”##3” -e “s#\”##3" ’
[/code]
[code]##############################################################################
>>> LOGINS
##############################################################################
(jakob´s config)
#DestroyFunc LoginsPopup
#AddToFunc LoginsPopup
#+ I Destroy recreate “Logins-dynamic”
#+ I AddToMenu “Logins-dynamic”
#+ I PipeRead ‘cat $[HOME]/.fvwm_button_shells|grep ‘^[^#]’|while read a b e; do echo " + %$b%$a $e"; done’
[/code]
This is the current Function, where i tried to make a branch. But i have no idea, how it works…
[code]##############################################################################
>>> WM-Menu
##############################################################################
(jakob´s config)
DestroyFunc WM_MENU_FUNC
AddToFunc WM_MENU_FUNC
- I Echo $0
#+ I test ( True “/usr/share/man/man1” ) Function ManpageBrowser - I test ( True ) Function ManpageBrowser
- I test ( EnvMatch $0 “$[FVWM_MODULEDIR]” ) Function ModuleBrowser
- I test ( EnvMatch $0 “/home/jakob/Wallpaper” ) Function WallpaperBrowser
[/code]
regards
scientific