PTP open in nautilus with gphoto

Archived topics about LMDE 1 and LMDE 2
Locked
shikmehmet

PTP open in nautilus with gphoto

Post by shikmehmet »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Oscar799
Level 20
Level 20
Posts: 10411
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: PTP open in nautilus with gphoto

Post by Oscar799 »

Moved here by moderator
Image
leone1522

Re: PTP open in nautilus with gphoto

Post by leone1522 »

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

Re: PTP open in nautilus with gphoto

Post by shikmehmet »

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
Locked

Return to “LMDE Archive”