access phone filesystem in command line

Simon Redman simon at ergotech.com
Fri Sep 21 16:00:35 BST 2018


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
>>
>> On 09/20/2018 04:23 PM, Nerijus Baliunas wrote:
>>> $ kdeconnect-cli --device a9fd38157b926107 --ping
>>> works
>>>
>>> With space:
>>>
>>> $ qdbus org.kde.kdeconnect /modules/kdeconnect/devices/a9fd38157b926107/sftp mountAndWait true
>>> Invalid number of parameters
>>>
>>> $ qdbus org.kde.kdeconnect /modules/kdeconnect/devices/a9fd38157b926107/sftp mountPoint /tmp/a
>>> Invalid number of parameters
>>>
>>> On Mon, 17 Sep 2018 17:27:40 -0600 Albert Vaca <albertvaka at gmail.com> wrote:
>>>
>>>> I think you are missing a space between org.kde.kdeconnect and
>>>> /modules/blablabla
>>>>
>>>> On Sun, Sep 16, 2018, 09:12 Nerijus Baliunas <nerijus at users.sourceforge.net>
>>>> wrote:
>>>>
>>>>> On Sun, 16 Sep 2018 17:39:00 +0300 Nerijus Baliunas <
>>>>> nerijus at users.sourceforge.net> wrote:
>>>>>
>>>>>> Thanks.
>>>>>> $ kdeconnect-cli -l
>>>>>> - Samsung Galaxy Note II: 122d674a200189a2 (suporuotas)
>>>>>> - Elephone: a9fd38157b926107 (suporuotas)
>>>>>> - Elephone: da7fdac5922f0762 (suporuotas)
>>>>>>
>>>>>> $ LANG=C kdeconnect-cli -l
>>>>>> - Samsung Galaxy Note II: 122d674a200189a2 (paired)
>>>>>> - Elephone: a9fd38157b926107 (paired and reachable)
>>>>>> - Elephone: da7fdac5922f0762 (paired)
>>>>>>
>>>>>> Lithuanian translation is incomplete and confusing, "paired and
>>>>> reachable"
>>>>>> should be "suporuotas ir pasiekiamas".
>>>>>>
>>>>>> $ kdeconnect-cli --device 122d674a200189a2 --unpair
>>>>>> Device does not exist
>>>>>>
>>>>>> Why?
>>>>>>
>>>>>> $ kdeconnect-cli --device a9fd38157b926107 --ping
>>>>>> error: No such object path
>>>>> '/modules/kdeconnect/devices/a9fd38157b926107/ping'
>>>>>> Why?
>>>>> Sorry, kdeconnect was not connected. When connected the ping works:
>>>>> $ kdeconnect-cli --device a9fd38157b926107 --ping
>>>>> (no output and phone pings)
>>>>>
>>>>> But:
>>>>> $ qdbus
>>>>> org.kde.kdeconnect/modules/kdeconnect/devices/a9fd38157b926107/sftp
>>>>> mountAndWait true
>>>>> Service
>>>>> 'org.kde.kdeconnect/modules/kdeconnect/devices/a9fd38157b926107/sftp' is
>>>>> not a valid name.
>>>>>
>>>>> $ qdbus
>>>>> org.kde.kdeconnect/modules/kdeconnect/devices/a9fd38157b926107/sftp
>>>>> mountPoint /tmp/a
>>>>> Service
>>>>> 'org.kde.kdeconnect/modules/kdeconnect/devices/a9fd38157b926107/sftp' is
>>>>> not a valid name.
>>>>>
>>>>> And ping stops working:
>>>>> $ kdeconnect-cli --device a9fd38157b926107 --ping
>>>>> error: No such object path
>>>>> '/modules/kdeconnect/devices/a9fd38157b926107/ping'
>>>>> It works after I kill and restart kdeconnect on a phone. But qdbus still
>>>>> does not work.
>>>>>
>>>>>> On Sat, 15 Sep 2018 19:47:46 -0600 Albert Vaca <albertvaka at gmail.com>
>>>>> wrote:
>>>>>>> Use kdeconnect-cli -l
>>>>>>>
>>>>>>> On Fri, Sep 14, 2018, 09:00 Nerijus Baliunas <
>>>>> nerijus at users.sourceforge.net>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> How do I know which id corresponds to my phone?
>>>>>>>>
>>>>>>>> On Fri, 14 Sep 2018 07:57:58 -0600 Albert Vaca <albertvaka at gmail.com
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Make sure your phone appears as reachable using the CLI and then
>>>>> use
>>>>>>>> qdbus
>>>>>>>>> again. Seems your phone was not connected to your PC when you ran
>>>>> that.
>>>>>>>>> On Fri, Sep 14, 2018, 06:12 Nerijus Baliunas <
>>>>>>>> nerijus at users.sourceforge.net>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> On Fri, 14 Sep 2018 04:51:47 -0700 Andy Holmes <
>>>>>>>>>> andrew.g.r.holmes at gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> I've never used qdbus myself so I don't know the CLI
>>>>> arguments, but
>>>>>>>> it
>>>>>>>>>>> looks like you have the well-known name (org.kde.kdeconnect)
>>>>> and the
>>>>>>>>>>> object path (/modules/kdeconnect/devices/122d674a200189a2) but
>>>>> you're
>>>>>>>>>>> missing the interface name 'sftp'.
>>>>>>>>>> Yes, sorry for that, I added /sftp as I wrote in another message,
>>>>>>>> didn't
>>>>>>>>>> help.




More information about the KDEConnect mailing list