Topic: Open mtp device (Creative Zen X-Fi) in Thunar
After a lot of reading and breaking things, i've found a way to mount my Creative Zen X-Fi in Thunar.
Here's the script:
#! /bin/bash
# script to mount/unmount Creative Zen X-Fi (or any other mtp device)
# by Tunafish
# March 2011
mountfolder=/home/nn/Zen # replace by a folder you want to use, folder must exist
available=$(lsusb | grep -c "Creative") # replace "Creative" by some unique identifier from lsusb for your device
if [ $available = 0 ]; then
zenity --warning --title="Player not found" --text="Player not found" --timeout=4 --height=160 --width=300
exit
fi
mounted=$(cat /etc/mtab | grep -c $mountfolder)
if [ $mounted = 1 ] ; then
title="Player mounted"
question="unmount"
else
title="Player not mounted"
question="mount"
fi
if zenity --question --title="$title" --text="Do you want to $question" --height=160 --width=300; then
if [ $mounted = 1 ] ; then
echo 'unmount'
fusermount -u $mountfolder
else
echo 'mount'
mtpfs $mountfolder
fi
fi
exit Last edited by Tunafish (2011-03-22 08:46:36)