Okay after a bit of dipping into the source code and some experimentation I have a working script
I'll post it here for future googlers to find
Basically when you click on the launcher in xfce's panel the script is called with either a "1" or a "0" added as a parameter. When the launcher is just querying the script no parameters are added and the output of the script is collected (it needs to be a "1" or a "0".
So here's the basic script...
Code:
#!/bin/sh
# mount
# 0 -> success
# 32 -> failed to mount
mpoint="/mnt/usb"
action=${1}
if [ $# -gt 0 ]; then
if [ ${action} = "1" ]; then
mount ${mpoint} > /dev/null
err=$?
if [ ${err} -eq 0 ]; then
#echo "success"
echo "1" > ~/.usbmount
fi
else
umount ${mpoint} > /dev/null
err=$?
if [ ${err} -eq 0 ]; then
#echo "success"
echo "0" > ~/.usbmount
fi
fi
else
cat ~/.usbmount
fi
This can definately be improved upon. Don't hesitate to post it here if ou do