access phone filesystem in command line
Nerijus Baliunas
nerijus at users.sourceforge.net
Tue Sep 25 13:23:47 BST 2018
Thank you, this works:
$ kdeconnect-cli --device a9fd38157b926107 --ping
$ qdbus org.kde.kdeconnect /modules/kdeconnect/devices/a9fd38157b926107/sftp mountAndWait
true
$ qdbus org.kde.kdeconnect /modules/kdeconnect/devices/a9fd38157b926107/sftp getDirectories
/run/user/500/a9fd38157b926107/storage/emulated/0: Visi failai
/run/user/500/a9fd38157b926107/storage/emulated/0/DCIM/Camera: Nuotraukos
$ qdbus org.kde.kdeconnect /modules/kdeconnect/devices/a9fd38157b926107/sftp mountPoint
/run/user/500/a9fd38157b926107
$ ls -l /run/user/500/a9fd38157b926107/storage/emulated/0/DCIM/Camera/
total 11520
-rw------- 1 nerijus nerijus 3841887 Sep 21 20:20 IMG_20180921_202023.jpg
-rw------- 1 nerijus nerijus 7951752 Sep 22 21:40 VID_20180922_213950.mp4
But unfortunately it works sporadically - sometimes ping does not work
(error: No such object path '/modules/kdeconnect/devices/a9fd38157b926107/ping'),
I had to restart kdeconnect on a PC and phone a few times for it to start working,
I got:
$ mv /run/user/500/a9fd38157b926107/storage/emulated/0/DCIM/Camera/* .
mv: error reading '/run/user/500/a9fd38157b926107/storage/emulated/0/DCIM/Camera/VID_20180922_213950.mp4': Transport endpoint is not connected
while moving files.
Thanks,
Nerijus
On Fri, 21 Sep 2018 09:00:35 -0600 Simon Redman <simon at ergotech.com> wrote:
> Because there is not yet anything there to read. The 'problem' is that
> the remote may have several filesystems. I agree that it would be more
> convenient to be able to list them with ls, but the main usecase for
> these interfaces is for use with Dolphin or some other automated system
> where the setup is handled automatically.
>
> You can get the individual filesystem mount points and their name with:
>
> $ qdbus org.kde.kdeconnect
> /modules/kdeconnect/devices/fea86568937f7291/sftp getDirectories
>
> /run/user/1000/fea86568937f7291/storage/emulated/0: All files
> /run/user/1000/fea86568937f7291/storage/emulated/0/DCIM/Camera: Camera
> pictures
>
> $ ls -al
> /run/user/1000/fea86568937f7291/storage/emulated/0
> total
> 868272
>
> drwx------. 1 simon simon 0 May 17 17:38
> Alarms
> drwx------. 1 simon simon 0 Jun 14 2017
> Android
> drwx------. 1 simon simon 0 May 18 14:08 audio
> - listing continues -
>
> On 09/21/2018 02:34 AM, Nerijus Baliunas wrote:
> > Thank you, now it almost works:
> > $ qdbus org.kde.kdeconnect /modules/kdeconnect/devices/a9fd38157b926107/sftp mountAndWait
> > true
> >
> > $ qdbus org.kde.kdeconnect /modules/kdeconnect/devices/a9fd38157b926107/sftp mountPoint
> > /run/user/500/a9fd38157b926107
> >
> > sftp is mounted:
> > $ df -h|grep kde
> > kdeconnect at 192.168.1.45:/ 1000G 0 1000G 0% /run/user/500/a9fd38157b926107
> >
> > $ mount|grep kde
> > kdeconnect at 192.168.1.45:/ on /run/user/500/a9fd38157b926107 type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=500,group_id=500)
> >
> > But:
> > $ ls -la /run/user/500/a9fd38157b926107
> > ls: reading directory '/run/user/500/a9fd38157b926107': Permission denied
> >
> > $ ls -ld /run/user/500/a9fd38157b926107
> > d--x------ 1 nerijus nerijus 0 Sep 19 04:11 /run/user/500/a9fd38157b926107
> >
> > Why mount directory permissions are execute only for user?
> >
> > On Thu, 20 Sep 2018 17:21:36 -0600 Simon Redman <simon at ergotech.com> wrote:
> >
> >> You may find it helpful to use a graphical dbus viewer to see the exact
> >> path names and requested arguments. I use d-feet, but there is also
> >> qdbusviewer (and presumably others)
> >>
> >> Neither mountAndWait nor mountPoint take an argument, so qdbus is trying
> >> to tell you that. Try:
> >>
> >> $ qdbus org.kde.kdeconnect
> >> /modules/kdeconnect/devices/fea86568937f7291/sftp mountAndWait
More information about the KDEConnect
mailing list