| 1 |
# Support for graphic viewer |
| 2 |
# Written by: Dominique Michel |
| 3 |
# |
| 4 |
# Only comix is supported at that time. |
| 5 |
# Any file in $fvwm_pic_path1 and 2 will be loaded |
| 6 |
# into $fvwm_pic_exec (comix). |
| 7 |
# Comix support the usual pictures formats as well than zip, |
| 8 |
# tar and rar archives with picture files. |
| 9 |
# |
| 10 |
# TODO: add more viewers. |
| 11 |
|
| 12 |
SetEnv fvwm_pic_path1 "/mnt/usb/$[USERDIR]/Pictures" |
| 13 |
SetEnv fvwm_pic_path2 "/home/$[USERDIR]/Pictures" |
| 14 |
SetEnv fvwm_pic_exec "comix" |
| 15 |
|
| 16 |
DestroyFunc FuncFvwmMenuPicDirectory |
| 17 |
AddToFunc FuncFvwmMenuPicDirectory |
| 18 |
+ I PipeRead 'case "$0" in \ |
| 19 |
"$[fvwm_pic_path1]"*) myexec="$[fvwm_pic_exec]";; \ |
| 20 |
"$[fvwm_pic_path2]"*) myexec="$[fvwm_pic_exec]";; \ |
| 21 |
esac; \ |
| 22 |
test -f "$0"/.icontitle.png && mytitle="$0"/.icontitle.png; \ |
| 23 |
test -f "$0"/.media.png && mypng="$0"/.media.png; \ |
| 24 |
fvwm-menu-directory --func-name "FuncFvwmMenuPicDirectory" \ |
| 25 |
--icon-title "${mytitle:-22x22/categories/directory.png}" \ |
| 26 |
--icon-file "${mypng:-22x22/categories/Graphics.png}" \ |
| 27 |
--dir "$0" --links \ |
| 28 |
--exec-file "^${myexec}"' |
| 29 |
|
| 30 |
DestroyMenu /Graphic/LoadPic |
| 31 |
AddToMenu /Graphic/LoadPic |
| 32 |
+ MissingSubmenuFunction FuncFvwmMenuPicDirectory |
| 33 |
+ '$[gt.Browse Pictures]' Popup $[fvwm_pic_path1] |
| 34 |
+ '$[gt.Browse Pictures]' Popup $[fvwm_pic_path2] |
| 35 |
DestroyMenu /Graphic |
| 36 |
AddToMenu /Graphic |
| 37 |
+ DynamicPopupAction Function /Graphic-generator |
| 38 |
|
| 39 |
DestroyFunc /Graphic-generator |
| 40 |
AddToFunc /Graphic-generator |
| 41 |
+ I DestroyMenu recreate /Graphic |
| 42 |
+ I AddToMenu /Graphic '$[gt.Load picture file]' Popup /Graphic/LoadPic |