--- Shawn Lamson <madzimambo@...> wrote:
> hey all -
> here's my question:
> busy etc... It works great when executed from a terminal window or
> xterm in X. But when i execute it via the menu/toolbar icon it won't
> sound the system bell ( i assume it has something to do with echo )
> so far the way i have found around this is to tell the icon to open
> xterm window
now i am echoing a CTRL-G to a /tmp/sound$$ file and then catting it -
it works! But let me know if there is a better way that you know of.
PS. Yes - i also found utilities like "eject" "eject -t" and "cdchk"
to help out!
> #----cut from $HOME/.icewm/menu
> #the first word "prog" means program ; CD is the title displayed ;
> #mounter is the name internal to Icewm and the rest is what is
> prog CD mounter xterm +ls -geom 5x3-0+0 -T '' -bg red -fg red -e
> #prog CD mounter mounter
> #----end of cut
> the uncommented one opens the xterm and it functions fine - opening a
> "small" xterm and echoing a bell... the commented one works great
> but no system bell.
> How can i get the system bell to sound - you'll note i also use xset
> to set duration etc at the bottom of the script - without opening a
> window to run this simple script?
> TIA - Shawn (script "mounter" follows)
> #shell program to mount / unmount cdrom drive
> #shawn lamson 06/24/2002
> set -x #uncomment for testing
> ERROR=' ERROR: mount or remount manually'
> # this program could grep the fields of /etc/fstab to find
> devices but doesnt
> # it assumes /cdrom as mount point and my current device
> if ! grep "$MOUNT_PT" /etc/fstab
> echo -e "Device $DEVICE is not set to mount in /etc/fstab\a"
> echo $ERROR
> exit 1
> if grep "$DEVICE" /etc/mtab
> if [ $STATUS = ON ]
> umount "$DEVICE" && cdcd open && echo -e "\a" && exit 0
> # this will fail if device is busy
> # should drop down to echo bell
> elif [ $STATUS = OFF ]
> cdcd close
> mount /cdrom
> echo -e "\a" #indicate CD is ready
> exit 0
> echo $ERROR
> echo "You may want to examine the output of #cat /etc/fstab"
> echo "and #cat /etc/mtab for clues"
> exit 1
> #this bell will execute if all else fails - for example device
> is busy
> echo "is device:$DEVICE busy?"
> xset b 100 700 1000 #set bell vol pitch duration
> echo -e "\a"
> xset b #sets bell back to defaults
> set +x #uncomment for testing
Debian/GNU Linux Woody
XFree86 Version 188.8.131.52 / X Window System
Jesus Loves You!
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup