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)

Re: Open mtp device (Creative Zen X-Fi) in Thunar

Hi,

Can you download music from mtp device, with thunar, or just to play it?
On Debian+KDE, I can upload to, and play from mtp dev. (with Amarok), but can't download. (I think it's possible, but I don't know, how, yet)
On Ubuntu I could download with file manager, and apparently it could upload, but after disconnecting the player didn't play the uploaded music.

Re: Open mtp device (Creative Zen X-Fi) in Thunar

kanyo wrote:

Hi,

Can you download music from mtp device, with thunar, or just to play it?
On Debian+KDE, I can upload to, and play from mtp dev. (with Amarok), but can't download. (I think it's possible, but I don't know, how, yet)
On Ubuntu I could download with file manager, and apparently it could upload, but after disconnecting the player didn't play the uploaded music.

I can copy files from my mtp device to harddisk with thunar, if that's what you mean.

Re: Open mtp device (Creative Zen X-Fi) in Thunar

I know this is a rather old post, so sorry for necromancy, but I just wanted to say thanks for the script! It works like a charm with a Creative Zen V Plus.

Ruby on rails webdev Noob -- Pygame Coder
Minecraft Addict -- Registered linux user 547693

Re: Open mtp device (Creative Zen X-Fi) in Thunar

AP3JAM wrote:

I know this is a rather old post, so sorry for necromancy, but I just wanted to say thanks for the script! It works like a charm with a Creative Zen V Plus.

Glad the script is useful to others!