Linux: configuring KDE Connect and connection to an Android phone

By | 06/24/2020
 

A really nice Android phone and a Linux OS integration.

Besides the KDE Connect, you can use gnome-shell-extension-gsconnect if you’d prefer the Gnome project.

In this post, we will set up KDE COnnect between an Android HTC phone and Arch Linux.

On Android install the KDE Connect from the Play Market.

On Linux, install from the repository:

[simterm]

$ sudo pacman -S kdeconnect

[/simterm]

For file exchanging feature – add the sshfs package:

[simterm]

$ sudo pacman -S  sshfs

[/simterm]

KDE connect connection

On your PC run the kdeconnectd, manually, for now, will add it to auto start later:

[simterm]

$ /usr/lib/kdeconnectd
qt5ct: using qt5ct plugin
kdeconnect.core: KdeConnect daemon starting
kdeconnect.core: My id: "_7d44a796_22cc_46c7_846a_a3ffef9b1247_"
kdeconnect.core: onStart
kdeconnect.core: KdeConnect daemon started
kdeconnect.core: Broadcasting identity packet
...

[/simterm]

Check on your mobile:

Check available devices from Linux:

[simterm]

$ kdeconnect-cli -l
- Desire 630 dual sim: da65691faaa832d6 (reachable)
1 device found

[/simterm]

Using the ID from the output above make a connection request:

[simterm]

$ kdeconnect-cli -d da65691faaa832d6 --pair
Pair requested

[/simterm]

Confirm on the Android:

And voila:

Now, run the kdeconnect-indicator:

[simterm]

$ kdeconnect-indicator

[/simterm]

In the systray you’ll see the connector icon from where with right-click you can check sync settings:

Permissions

Go back to your phone, and scroll down – find permissions:

Go to the Settings and enable the Notifications access:

Go back and in the Some plugins have features disabled […] give all other permissions starting from the Filesystem expose:

Chose the disk on your phone, grant access to it via sshfs, on this screenshot, it will be my SD card:

Browse devises and files transfer

Chose Browse device:

And via sshfs you have access to the SD card configured above:

Syslogs:

[simterm]

kdeconnect.plugin.sftp: Starting process:  "sshfs [email protected]:/ /run/user/1000/da65691faaa832d6 -p 1739 -s -f -F /dev/null -o IdentityFile=/home/setevoy/.config/kdeconnect/privateKey.pem -o StrictHostKeyChecking=no -o UserKno
wnHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-dss -o uid=1000 -o gid=1000 -o reconnect -o ServerAliveInterval=30 -o password_stdin"

[/simterm]

Ring mobile

Nice feature – “Find my phone in my apartment” called Ring device:

And the phone will start ringing (even if it’s muted) with the following button on its screen:

 

Multimedia control

Also, you can control a player in a browser on your Linux from your phone:

Even more – you’ll have a button on the Andoird welcome screen:


A mouse control

You can move your mouse cursor on your Linux from your mobile now:

Linux notifications

Systray notifications can be used with standard  org.freedesktop.Notifications.

This is really handy in the office where I’m muting the ring sound on the phone, but now I’ll not miss any SMS/call as I’ll see them on my desktop.

Check the D-Bus to see how is acceptin Notifications in the system:

[simterm]

$ qdbus --session org.freedesktop.DBus / org.freedesktop.DBus.GetConnectionUnixProcessID org.freedesktop.Notifications
881

[/simterm]

Check the PID:

[simterm]

$ ps uax | grep -w 881
setevoy      881  0.0  0.2 286260 44824 tty1     Sl   11:15   0:00 lxqt-notificationd

[/simterm]

In my case this the lxqt-notificationd.

And the notification itself, for example during an incoming call:

Autostart

Weird a bit that it has no any systemd unit-file.

In the Openbox, I just added the kdeconnectd and kdeconnect-indicator to my ~/.config/openbox/authostart:

...
/usr/lib/kdeconnectd &
...
kdeconnect-indicator &
...

That’s all.

Actually, KDE Connect gives much more abilities then described in this post, so – just play with it.