KDEConnect

From KDE UserBase Wiki
Revision as of 07:43, 5 November 2022 by Claus chr (talk | contribs) (Created page with "Når begge enheder er forbundne, så test, at de kan kommunikere over VPN ved at foretage et netværks-ping imellem dem.")

Had er KDE Connect?

KDE Connect er et projekt, som lader alle dine enheder kommunikere med hinanden. Her er et par af det ting KDE Connect kan gøre:


  • Modtage nekendtgørelser fra din mobiltelefon på din computer og svare på beskeder.
  • Kontrollere afspilning af musik på din computer fra din mobil
  • Bruge din mobil som fjernkontrol til din computer
  • Køre forhåndsdefinerede kommandoer på din computer fra tilsluttede enheder. Se listen med eksempler på kommandoer for flere detaljer.
  • Tjek din mobils batteriniveau fra computeren
  • Ring til din mobil for at hjælpe med at finde den
  • Dele filer og links imellem enheder
  • Gennemse din mobil fra skrivebordet
  • Kontrollere computerens lydstyrke fra din mobil
  • Sende SMS'er fra din computer

Installation

Du kan højst sandsynligt finde KDE Connects skrivebordskomponent som en pakke i din distributions arkiver. Hvis ikke, så kan du bede dem om at tilføje den.

Fejlagtige forestillinger til trods kan du bruge KDE Connect i ethvert skrivebordsmiljø. Da de fleste af udviklerne bruger Plasme, så kan det være, at en funktion ikke virker eller er utilgængelig i et andet skrivebordsmiljø. I så fald beder vi dig indsende en fejlrapport. Der er mange måder at forbedre oplevelsen af KDE Connect i andre miljøer end Plasme. Hvis du bruger GNOME vil du måske foretrække GSConnect, som er en udvidelse til GNOME shell. Til miljøer, som understøtter AppIndicator (Budgie, Cinnamon, LXDE, Pantheon, Unity) findes indicator-kdeconnect.

Android-appen kan findes i Google Play Store og den fri og åbne appstore F-Droid.

Der var noget arbejde på en KDE Connect-klientapp til iOS i 2014 (se source code), som lå stille i nogle år indtil det blev genoptaget omkring 2018-19 med nogle rettelser og understøttelse af TLS. I 2021 blev der påbegyndt et større projekt med opdatering af meget af den gamle kodebase på nyere fundamenter med mulighed for fremtidig udvidelse.

KDE Connect findes også på sailfish-connect og vi arbejder på at bringe den til andre Linux-based mobiltelefoner (Plasma Mobile, PostmarketOS etc.)

Se KDE Connects downloadside

Oversigt

Dette er siden med dokumentation til KDE Connect. Du kan se fællesskabets side her: community.kde.org/KDEConnect, som forklarer, hvad KDE Connect er og hvordan man installerer det.

KDEConnect har to komponenter. Programmet til computeren og mobilapp'en.

Parring af to enheder

Først skal du åbne KDE Connect på din computer og mobil. Du skulle nu på hver skærm kunne se navnet på den enhed, som du vil parre med. Hvis det ikke virker, så sørg for, at de to enheder er forbundet til det samme netværk og at der ikke er en firewall, som blokerer for, at de to enheder kan se hinanden. Se afsnittet om fejlsøgning.

Du kan nu bede om, at få de to enheder parret. På den anden enhed dukker der et vindue op, hvor du bliver bedt om at acceptere parringen. Bekræft det; så er du færdig. Dine enheder er nu parrede.

Mens en typisk konfiguration vil omfatte en computer og en mobil, så er det også muligt at parre to computere.

Integration af browser

Plasma Browser Integration gør KDE Connect endnu stærkere. Den lader dig styre indhold fra fx Youtube og Netflix fra din mobil og sende browser-faneblade til din mobil. På trods af navnet kan den også bruges på andre skriveborde end Plasma.

Ændring af enheders navne

Du kan kun ændre en enheds navn på enheden selv. Hvis du vil ændre navnet på din computer skal du altså bruge skrivebordsprogrammet, og hvis du vil ændre navnet på din mobil eller tablet, så skal du ændre det i KDE Connect-appen. Når en enhed har fået ændret sit navn, så bliver dette automtisk synkroniseret til alle forbundne enheder.

Kør KDE Connect over OpenVPN

Der kan være mange grunde til at bruge KDE Connect over VPN. Måske er du væk hjemmefra og vil køre en kommando, eller måske er du tilsluttet et offentligt wifi-netværk, som ikke tillader enheder at kommunikere og du vil bruge enheden som fjernkontrol til at give en præsentation.

Opsætning af OpenVPN

Hvis du har din egen server med en IP-adresse, som kan tilgås udefra, så kan du selv opsætte OpenVPN. Det er ikke det nemmeste software at sætte op, men ved at følge en vejledning i opsætning som fx denne skulle du kunne klare det.

KDE Connect bruger UDP broadcast packets til at finde to enheder. For at tillade det, skal OpenVPN opsættes til bridging (TAP enhed). Hvis du bruger en tun-enhed kan du stadig forbinde manuelt med IP-adresse.

Hvis du vil leje en forhånds-konfigureret OpenVPN-service i stedet for at opsætte din egen, så skulle det fungere, men du skal tage hensyn til de samme overvejelser om server-indstillinger.

Når først serveren kører kan du bruge den officielle OpenVPN-klient til at forbinde computeren med serveren. Der er ingen officiel OpenVPN-klient til Android, men OpenVPN for Android-klienten fungerer godt: openvpn

Når begge enheder er forbundne, så test, at de kan kommunikere over VPN ved at foretage et netværks-ping imellem dem.

Configure KDE Connect

If your OpenVPN instance is set up for bridging, KDE Connect should work just like on a local network.

If you are using OpenVPN with a tun device, you will have to manually add your devices by IP. Then, once you connect to the VPN, KDE Connect should automatically detect your device and either connect or be ready for pairing!

Available Plugins

Battery Monitor

"Show your phone battery next to your computer battery."

By enabling this, the KDE Connect widget on your panel tray will display your phone's battery.

Clipboard

"Share the clipboard between devices."

With this, you can simply copy text from your computer and it will be immediately available to paste on your phone, and vice-versa. This does not work with images though.

Auto-sync on Android 10+

Android 10 prevents apps from accessing the clipboard to prevent malicious apps from accessing your data. This makes the clipboard plugin in KDE Connect uncomfortable to use.

Magisk Module (root only)

If you are rooted, you can use a Magisk module to remove this restriction.

Log Reading

If you have a build containing commit edc655da5ac1eb5c3027c8556cc62037a1d4c5ac, you can enable the READ_LOGS permission in order to enable a workaround to clipboard sync.

Run these commands:

adb -d shell pm grant org.kde.kdeconnect_tp android.permission.READ_LOGS;
adb -d shell appops set org.kde.kdeconnect_tp SYSTEM_ALERT_WINDOW allow;
adb -d shell am force-stop org.kde.kdeconnect_tp;

How does it work?

With log reading enabled, KDE Connect watches its own log. If it sees a line indicating that it has been denied access to read the clipboard, it pops up an invisible window to the foreground, grabs the clipboard, and closes the window.

Contacts

"Synchronize contacts between devices"

This plugin silently synchronizes contacts, in vcard format, from your phone to your desktop.

As of this writing, the synchronization is one-way, with data being sent from the Android implementation to the desktop, to be consumed by any application which uses the KPeople library with the KPeopleVCard plugin, such as the KDE Connect SMS app.

VCard Location

On non-Windows platforms, contact cards are written to QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kpeoplevcard". This might be configured differently by your system, but normally resolves to ~/.local/share/kpeoplevcard.

On Windows, the path resolves to %LocalAppData%.

Inhibit Screensaver

"Inhibit the screensaver when the device is connected."

This makes sure that your screensaver will not run while your device is connected.

Multimedia Control Receiver

"Remote control your music and videos."

With this feature, you can control your music and videos remotely, with pause/play, previous/next, 5 s before/later. You can also change which media player to control, in addition to application and system volume.

Multimedia control receiver with KDE Connect in Android
Multimedia control receiver with KDE Connect in Android

Pause Media During Calls

"Pause music/videos during a phone call."

Pause music/videos during a call. This feature can be powerful when combined with Plasma Browser Integration. For example, when you are listening to some music on Peertube or Youtube, the video will be paused whenever you receive a call.

You can configure this option to pause only when you pick up your phone or directly when your phone starts to ring. You can also decide if you want to only pause the media player or/and mute the system sound.

Ping

"Send and receive pings."

This serves to test your connection to a given device. Once selected, a "Ping!" will appear as a notification on your receiving device.

On your desktop, you can send a ping through the KDE Connect settings or through the widget on the tray.

On your phone, you can send a ping through the upper right hamburger menu on the KDE Connect app.

Send a ping to your computer with android
Send a ping to your computer with android

Receive Notifications

"Show your phone notifications on your computer and keep them in sync."

This keeps you in touch with what happens on your phone! Any notifications you receive on your phone will be shown in your computer. Some notifications, such as those of Instant Messengers (IM) like Telegram can be replied on the fly through the computer notification itself.

Remote File System Browser

"Browse the remote device filesystem using SFTP."

This allows you to access your phone storage! When enabled, a device will appear in Dolphin with which you can navigate your external storage.

Ring My Phone

"Find your lost phone by making it play an alarm sound."

This also serves to test your connection to a given device, and by ringing your phone remotely, you can quickly find its location!

Run Commands

"Execute console commands directly."

With KDE Connect, you can run predefined commands on your computer by pressing buttons on your phone! Instructions on how to add a command are shown in userbase. A set of useful commands can also be found here. Some sample commands, such as suspend and lock screen, are also available.

Send Notifications

"Broadcast this computer's notifications, so they can be shown on other devices."

This is pretty self-explanatory: notifications from your computer will show up on your phone.

You can configure if you want to send the notification description, the icons pertaining to the application and persistent or very important notifications. This keeps you in touch with what happens on your computer! Any notifications you receive on your computer will be shown in your phone.

Share and Receive

"Receive and send files, URLs or plain text easily."

This integrates your desktop and your browser so that you can right-click on files or links and send it immediately to your phone!

Files show the right-click option "Send to phone via KDEConnect" and will send the file directly, showing it among your notifications.

Links show the right-click option "Open on phone" and will automatically open your phone's default browser on the chosen website. Really handy!

When receiving files from your phone into your computer, they will go to your Downloads folder by default. If you wish, you can change that too.

Telephone Integration

"Show notifications for incoming calls."

Whenever you get a call on your phone, a notification telling you which number is calling appears. Paired with "Pause media during calls", you'll surely be able to answer readily and never lose a call!

Virtual Input

"Use your phone as a touchpad and keyboard."

With this enabled, by going to your phone app and selecting Remote input, a touch screen will immediately be available for you to control your computer mouse, similarly to a touchpad. One touch equals one click.

The keyboard icon in the upper right allows you to type on your phone and see the result on your computer too.

If you press the hamburger menu right by its side, you'll be able to send right and middle clicks.

Presentation control

It is possible to control presentations using the previous/next slide button. When the device is locked, you can use the volume up/down button to do that. You can also highlight something using the laserpointer. Just move your phone and the blue circle will follow! Using the hamburger menu, you can toggle fullscreen (F5) or quit the presentation (Esc).

Troubleshooting

I have two devices running KDE Connect on the same network, but they can't see each other

KDE Connect uses dynamic ports in the range 1714-1764 for UDP and TCP. So if you are behind a firewall, make sure to open this port range for both TCP and UDP. Otherwise, make sure your network is not blocking UDP broadcast packets.

Check that the process is listening on the network:

sudo netstat -tunelp | grep -i kdeconnect

Are the ports open/blocked?

netcat -z -v <your-phones-ip> 1714-1764

Example output:

Connection to <your -phones-ip> 1716 port [tcp/*] succeeded!

You also get lots of Connection refused, but you need 1 “succeeded”

ufw

If your firewall is ufw, you can open the necessary ports with:

sudo ufw allow 1714:1764/udp
sudo ufw allow 1714:1764/tcp
sudo ufw reload

firewalld

If your firewall is firewalld, you can open the necessary ports with:

sudo firewall-cmd --permanent --zone=public --add-service=kdeconnect
sudo firewall-cmd --reload

Firewall Configuration (firewall-config)

Open Firewall Configuration (firewall-config). In ZonesServices, check the kde-connect service.

Make sure you choose the "Permanent" Configuration: option in the drop-down menu at the top, otherwise rebooting will discard your settings changes.

iptables

If your firewall is iptables, you can open the necessary ports with:

sudo iptables -I INPUT -i <yourinterface> -p udp --dport 1714:1764 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -I INPUT -i <yourinterface> -p tcp --dport 1714:1764 -m state --state NEW,ESTABLISHED -j ACCEPT

sudo iptables -A OUTPUT -o <yourinterface> -p udp --sport 1714:1764 -m state --state NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -o <yourinterface> -p tcp --sport 1714:1764 -m state --state NEW,ESTABLISHED -j ACCEPT

KDE Connect crashes or restarts when trying to pair with another device

Sometimes, a corrupt config file may cause KDE Connect to crash when trying to pair with a device. In that case, deleting the config ~/.config/kdeconnect might help.

KDE Connect Android app crashes

If the KDE Connect Android app crashes, you might be able to get more information about the crash by using adb logcat.

Set up ADB using the official instructions

The following command should list all information relevant to your crash. Run adb logcat *before* triggering the crash.

adb logcat --pid=$(adb shell pidof -s org.kde.kdeconnect_tp)

Can I run KDE Connect without a display server?

Yes, you can pass the command line argument `-platform offscreen` to the daemon (eg: `killall -9 kdeconnectd; /usr/lib/libexec/kdeconnectd -platform offscreen`)

GSConnect

GSConnect is an independent project which implements the KDE Connect protocol into GNOME and uses the same Android app. If you are running GSConnect, please visit that project's GitHub page first for support. If you and the GSConnect team determine the issue is the Android app or protocol, feel free to report those in the KDE Connect bug tracker.

My problem is not in this list :(

In case you find a bug and want to report it, you can do so in the KDE bug tracker.