#!/usr/bin/X11/wafe --f
# script to mount floppy drive

set driveA /dev/fd0
set mountA /a

mergeResources topLevel {
  *background lightSteelBlue 
  *Command.sensitive false 
  *font "-b&h-lucida-bold-r-*-*-12-*-*-*-p-*-iso8859-*"
}

Form f topLevel translations "<Key>q: exec(quit)"
  Command mount f \
     label "Mount $mountA" \
     callback {execute "/etc/mount -t msdos $driveA $mountA" mount unmount} 
  Command unmount f \
     label "UnMount $mountA" \
     callback {execute "/etc/umount $mountA" unmount mount} \
     fromVert mount

realize

if [string match *$driveA* [exec /bin/mount]] {
    sV unmount sensitive true
} else {
    sV mount sensitive true
}

proc execute {cmd this other} {
    if [catch "exec $cmd"] { bell topLevel 1 } else {
	sV $this sensitive false; sV $other sensitive true 
    } 
}



