This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Using kioslaves in shell scripts

Tags: None
(comma "," separated)
Hoth
Registered Member
Posts
3
Karma
0
OS

Using kioslaves in shell scripts

Thu Jun 08, 2017 6:02 pm
I've been wondering for a while whether there's any way to use kioslaves -- particularly camera:/ -- in a bash script.

The context is I've got this little script to handle rotating and resizing photos from my camera:
Code: Select all
#!/bin/bash
chmod 777 /home/pgk/convertme/*.JPG
cd /home/pgk/convertme/
cd "/home/pgk/convertme"; ls *.JPG | xargs -I NAME convert NAME -rotate "-90<" NAME
cd "/home/pgk/convertme"; ls *.JPG | xargs -I NAME convert NAME -resize 50% -quality 95 NAME
cp /home/pgk/convertme/* "/home/pgk/Documents/Pictures/new pics"
rm /home/pgk/convertme/*.JPG


But after plugging my camera in I still have to open up dolphin and go to camera:/ and navigate down and copy the photos from there into /home/pgk/convertme... I'd really like to automate that part. I tried
Code: Select all
cp -R camera:/USB%2520PTP%2520Class%2520Camera@usb:005,014/store_00010001/DCIM/100KC195/* /home/pgk/convertme/
but it doesn't work.

I've also tried mounting the old fashioned way but mysteriously haven't seemed to be able to find the right /dev/ device or something... if there's a way to use kioslaves that'd be simpler.
wolfi323
Registered Member
Posts
1129
Karma
11
OS

Re: Using kioslaves in shell scripts

Fri Jun 09, 2017 11:54 am
Hoth wrote:I tried
Code: Select all
cp -R camera:/USB%2520PTP%2520Class%2520Camera@usb:005,014/store_00010001/DCIM/100KC195/* /home/pgk/convertme/
but it doesn't work.

Try to use "kdecp5" (or "kde-cp") instead, that should do what you want.
It doesn't seem to support wild cards, but if you leave out the * it should copy all files anyway.

E.g.:
Code: Select all
kdecp5 camera:/USB%2520PTP%2520Class%2520Camera@usb:005,014/store_00010001/DCIM/100KC195/ /home/pgk/convertme/


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]