PTP open in nautilus with gphoto

Archived topics about LMDE 1
Forum rules
shikmehmet
Level 1
Level 1
Posts: 15
Joined: Mon Dec 06, 2010 12:58 pm

PTP open in nautilus with gphoto

Postby shikmehmet » Wed Dec 28, 2011 4:59 pm

Hello everyone and happy new year !

I used to have a 'UBUNTU' version of linux mint with gnome, now i have LMDE.

on the ubuntu sorced version plugging in a ptp camera would make it show up on the desktop and in nautilus, and then clicking that would show all the thumbnails and file directory of the camera in nautilus , life was sweet ;)


With lmde, no such thing happens , after 8 months i have found a way to get it to work, but it is not optimal and i would like to ask for your combined help.

this is what i do >

plug in camera via usb

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 04a9:31e1 Canon, Inc.

this tells me the camera is recognised
then i

~ $ gphoto2 --auto-detect
Model Port
----------------------------------------------------------
USB PTP Class Camera usb:001,004

this tells me the little usb numbers i need, note these change all the time, sometmies it is 003, sometimes 004,

usinig the usb numbers from above i write this little line

gphoto2://[usb:001,004]

i take this line and put it into nautilus , i use the key combination ctrl+l , and this lets me put in the address i want, here i put in the above line , and then magic

the little icon comes up on the desktop, and it comes up in nautilus just as if it were a usb drive. Now i have access to my camera without the hassle of f-photo or gtkam etc etc. I can drag and drop, delete etc, using the nautilus.

How can i get this to happen automattically, in ubuntu this happens automatically with the icons appearing on the desktop and i just click it. This is a bit of a process to do everytime i want to access my camera. There must be a script for this, if any one can help i would really like it.

Thanks guys

Cheers

User avatar
Oscar799
Level 19
Level 19
Posts: 9433
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: PTP open in nautilus with gphoto

Postby Oscar799 » Thu Dec 29, 2011 5:39 am

Moved here by moderator
Image
"Don't fix it if it ain't broken,don't break it if you can't fix it" Husse
Registered Linux User #511789

leone1522
Level 1
Level 1
Posts: 1
Joined: Tue Jan 03, 2012 3:32 am

Re: PTP open in nautilus with gphoto

Postby leone1522 » Tue Jan 03, 2012 3:39 am

Hi,
i've created a little script that handles both PTP and MSC-type cameras.
best regards
leone1522

Code: Select all

#!/bin/bash
#
#If the camera supports PTP (Picture Transfer Protocol), it shows up like this:
#   gphoto2 --auto-detect
#
#   Modell                         Port                                           
#   ----------------------------------------------------------
#   Fuji FinePix F100fd            usb:001,004     
#
#If the camera uses MSC (mass storage class), it shows up like this:
#   gphoto2 --auto-detect
#   Modell                         Port           
#   ----------------------------------------------------------
#   Mass Storage Camera            disk:/media/disk
#
#

echo "starting" > /tmp/gphoto_ptp.log
gphoto2 --auto-detect >> /tmp/gphoto_ptp.log

CAMPORT=`gphoto2 --auto-detect|awk 'NR==3 {print substr($0,32,11)}'`
echo "CAMPORT=$CAMPORT" >> /tmp/gphoto_ptp.log

if [[ "$CAMPORT" =~ usb* ]]
then
   gvfs-mount "gphoto2://[${CAMPORT}]/"
   echo "mounted" >> /tmp/gphoto_ptp.log
   gvfs-mount --list >> /tmp/gphoto_ptp.log
fi

gthumb --import-photos
echo "gthumb" >> /tmp/gphoto_ptp.log

if [[ "$CAMPORT" =~ usb* ]]
then
   gvfs-mount -u "gphoto2://[${CAMPORT}]/"
   echo "unmounted" >> /tmp/gphoto_ptp.log
   gvfs-mount --list >> /tmp/gphoto_ptp.log
fi
echo "finished" >> /tmp/gphoto_ptp.log

shikmehmet
Level 1
Level 1
Posts: 15
Joined: Mon Dec 06, 2010 12:58 pm

Re: PTP open in nautilus with gphoto

Postby shikmehmet » Sun Mar 04, 2012 3:13 pm

Hello,

thank you , that might be just the ticket i was looking for,

Sorry for not getting back to you earlier, i expected to get an email from the forum telling me someone had replied.

Please tell me where to put that script , how should i make it do what it is supposed to do.

with much regards
Shikmehmet


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 1 guest