Two-state Launcher for CD-ROM drives in Mandrake 9.1

Paul M. Bucalo pmbuc at pmbenterprises.com
Sun Feb 1 23:03:45 CET 2004


A while back someone was kind and generous enough to post a wonderful 
script for mounting/unmounting CD-ROM drives using XFce's two-state 
launchers. Here it is for those who aren't aware of it:

#!/bin/sh
# script to mount/umount cdrom
# for use with xfce4-trigger-launcher
if [ "$1" = "1" ]; then
    mount /mnt/cdrom &> /dev/null
elif [ "$1" = "0" ]; then
    eject /mnt/cdrom &> /dev/null
else
    STATUS=`grep cdrom /proc/mounts`
    if [ "x$STATUS" = "x" ]; then
        echo 0
    else
        echo 1
    fi
fi

This script worked perfectly in Red Hat 9, even with the slight 
modification to the drive numbering to distinguish between the CD-ROM 
and CD-RW drive in that particular box. In Mandrake 9.1, the opposite 
is true. Both launchers show that they are always mounted. If I put a 
CD in, it eventually cycles through the script and ejects it back out. 
The scripts are identical to the ones successfully used in Red Hat 9, 
with only one difference: The second ROM drive in the MDK 9.1 box is 
denoted as '/mnt/cdrom2' (instead of '/mnt/cdrom1' in RH 9) by the 
O/S. 

Anyone using Xfce-4.0.3.0.1 on Mandrake 9.1, and using this same 
script with success? Any changes recommended for this distro? If 
anyone has a better, or just plain working, script for MDK 9.1, 
*p-l-e-a-s-e* tell me! :0/

TIA,

Paul





More information about the Xfce mailing list