I made some changes to the explorer_cd script. It is set up for my own KDE3 desktop. You can easily specify which programs to use by editing the variables FILEMAN, PLAYCD, PLAYDVD and BURNDISC. Copy the code below and paste it into /usr/bin/explorer_cd (as root, and you should make a backup of the original script). You do need zenity and gtkdialog installed. Run the script from a terminal so you can see any error messages.
#!/bin/sh
# Mount and view device
# License : GNU GPL
# (c) Eko M. Budi, 2004
# (c) Vector Linux, 2004
# Modified by Nightflier for Vector Linux 6.0
# Specify programs to use
FILEMAN="konqueror"
# note that some file managers, like pcmanfm, will not work
# as they don't stop the script when mounting, causing an immediate unmount
PLAYCD="xmms /mnt/cdrom"
PLAYDVD="xine -D -f -g dvd:/"
BURNDISC="k3b"
# Display options menu
export MAIN_DIALOG='
<window title="CD/DVD" icon-name="menu-Reload.png">
<vbox>
<hbox>
<button>
<label>" Data Disc "</label>
<input file>/usr/share/icons/ROX-nuvola/filesystems/folder_blue.png</input>
<action>echo DATA > /tmp/cd-dvd-choice</action>
<action>killall gtkdialog</action>
</button>
</hbox>
<hbox>
<button>
<label>" Audio CD "</label>
<input file>/usr/share/icons/ROX-nuvola/apps/kscd.png</input>
<action>echo AUDIO > /tmp/cd-dvd-choice</action>
<action>killall gtkdialog</action>
</button>
</hbox>
<hbox>
<button>
<label>" Video DVD "</label>
<input file>/usr/share/icons/ROX-nuvola/apps/xine.png</input>
<action>echo VIDEO > /tmp/cd-dvd-choice</action>
<action>killall gtkdialog</action>
</button>
</hbox>
<hbox>
<button>
<label>" Burn "</label>
<input file>/usr/share/icons/ROX-nuvola/devices/cdwriter_mount.png</input>
<action>echo BURN > /tmp/cd-dvd-choice</action>
<action>killall gtkdialog</action>
</button>
</hbox>
<hbox>
<button cancel></button>
</hbox>
</vbox>
</window>
'
gtkdialog --program=MAIN_DIALOG
# what does user want to do?
choice=$(cat /tmp/cd-dvd-choice)
rm /tmp/cd-dvd-choice
# mount data disc and explore in file manager
if [ "$choice" = "DATA" ];then
for i in 5 4 3 2 1; do
DEVICES="$*"
[ -z "$DEVICES" ] && DEVICES="/dev/cdwriter /dev/dvd /dev/cdrom $(/sbin/probedisk |grep "|cdrom|"|cut -d "|" -f1)"
for DEV in $DEVICES; do
# Find entry in /etc/fstab
echo Trying $DEV ...
LINE=`grep -e "^\s*$DEV" /etc/fstab`
if [ $? = 0 ]; then
# Get the mount point
MNT=`echo $LINE | cut -f2 -d ' '`
# Test if mount point has being mounted
df | grep "$MNT" > /dev/null
if [ $? = 0 ]; then
echo "$MNT has being mounted"
DEV=""
else
echo "Going to mount it at $MNT"
if ! mount $MNT; then
continue;
fi
# Give time to settle
sleep 3
fi
# explore it
# if [ -e /usr/bin/xfe ];then xfe $MNT;else xterm -e mc $MNT;fi
if [ ! -z $(which $FILEMAN) ];then $FILEMAN $MNT;else xterm -e mc $MNT;fi
# unmount if necessary
if [ "$DEV" ]; then
umount $MNT
if [ ! $? = 0 ]; then
echo "WARNING" "Could not unmount $DEV."
fi
fi
exit 0
fi
done
echo "Trying again.. ($i)"
sleep 5
done
# If it goes this far, there is something amiss
zenity --error --title "Error" --text " Possible causes: \n - No disc in drive \n - Drive not ready \n - No drive found"
exit 1
fi
# play audio CD
if [ "$choice" == "AUDIO" ];then
if [ "$(wodim -toc | grep "track:" -o)" ];then
# xmms /mnt/cdrom &
$PLAYCD &
exit 0
else
zenity --error --title "Error" --text " No audio CD found"
fi
fi
# play video DVD
if [ "$choice" == "VIDEO" ];then
# xine -D -f -g dvd:/ &
$PLAYDVD &
exit 0
fi
# burn (re)writable CD
if [ "$choice" == "BURN" ];then
$BURNDISC &
exit 0
fi