Ok I’ll try to make it clear:
I use the following functions :
[code]###########
Mount menu
###########
DestroyMenu MenuMount
AddToMenu MenuMount
- DynamicPopupAction Function MountCheck
#########
First a mount/unmount function
used in the file MenuMount generated by mount.sh
#########
DestroyFunc ToggleMount
AddToFunc ToggleMount
- I PipeRead ‘mount $0 || umount $0’
- I Exec exec $[fvwm_scripts]/mount.sh
- I Read $[FVWM_USERDIR]/MenuMount
###########
MountCheck function
###########
DestroyFunc MountCheck
AddToFunc MountCheck
- I Function UpdateMenuMount
- I DestroyMenu recreate MenuMount
- I AddToMenu MenuMount “.: Mount :.” Title
- I PipeRead “cat $[FVWM_USERDIR]/MenuMount”
##########
UpdateMenuMount
#########
DestroyFunc UpdateMenuMount
AddToFunc UpdateMenuMount
- I PipeRead “if [ -f $HOME/.fvwm/MenuMount ]; then rm $HOME/MenuMount; fi”
- I Exec exec $[fvwm_scripts]/mount.sh
[/code]
You have to place the following in your menu:
+ "Mount" popup MenuMount
the mount.sh script is then:
[code]#!/bin/bash
floppy=grep -c floppy < /etc/mtab
cdrom=grep -c cdrom < /etc/mtab
mp3player=grep -c mp3player < /etc/mtab
digital_camera=grep -c digital_camera < /etc/mtab
removable=grep -c removable < /etc/mtab
doc=grep -c doc < /etc/mtab
multimedia=grep -c multimedia < /etc/mtab
sounds=grep -c sounds < /etc/mtab
[ -e $HOME/.fvwm/MenuMount ] && rm $HOME/.fvwm/MenuMount
case $floppy in
0)
echo ‘+ %4.png%“Floppy” Function ToggleMount /media/floppy’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %5.png%“Floppy” Function ToggleMount /media/floppy’ >> $HOME/.fvwm/MenuMount
;;
esac
case $cdrom in
0)
echo ‘+ %2.png%“Cdrom” Function ToggleMount /media/cdrom’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %3.png%“Cdrom” Function ToggleMount /media/cdrom’ >> $HOME/.fvwm/MenuMount
;;
esac
case $mp3player in
0)
echo ‘+ %6.png%“Mp3player” Function ToggleMount /media/mp3player’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %7.png%“Mp3player” Function ToggleMount /media/mp3player’ >> $HOME/.fvwm/MenuMount
;;
esac
case $digital_camera in
0)
echo ‘+ %10.png%“Digital camera” Function ToggleMount /media/digital_camera’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %11.png%“Digital camera” Function ToggleMount /media/digital_camera’ >> $HOME/.fvwm/MenuMount
;;
esac
case $removable in
0)
echo ‘+ %8.png%“Removable” Function ToggleMount /media/removable’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %9.png%“Removable” Function ToggleMount /media/removable’ >> $HOME/.fvwm/MenuMount
;;
esac
case $doc in
0)
echo ‘+ %0.png%“Doc” Function ToggleMount /mnt/doc’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %1.png%“Doc” Function ToggleMount /mnt/doc’ >> $HOME/.fvwm/MenuMount
;;
esac
case $multimedia in
0)
echo ‘+ %0.png%“Multimedia” Function ToggleMount /mnt/multimedia’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %1.png%“Multimedia” Function ToggleMount /mnt/multimedia’ >> $HOME/.fvwm/MenuMount
;;
esac
case $sounds in
0)
echo ‘+ %0.png%“Sounds” Function ToggleMount /mnt/sounds’ >> $HOME/.fvwm/MenuMount
;;
1)
echo ‘+ %1.png%“Sounds” Function ToggleMount /mnt/sounds’ >> $HOME/.fvwm/MenuMount
;;
esac
[/code]
of course, the images have to be in your ImagePath!
HTH and let me know if you succeed.
Brice