You can control your Linux PC from your Android phone - here's how

You can control your Linux PC from your Android phone - here's how - Overview
You can control your Linux PC from your Android phone - here's how

💡 Quick Summary

'ZDNET Recommends': What exactly does it mean? ZDNET's recommendations are based on many hours of testing, research, and comparison shopping. We gather data from the best available sources, including vendor and retailer listings as well as other rele...

'ZDNET Recommends': What exactly does it mean?

ZDNET's recommendations are based on many hours of testing, research, and comparison shopping. We gather data from the best available sources, including vendor and retailer listings as well as other relevant and independent reviews sites. And we pore over customer reviews to find out what matters to real people who already own and use the products and services we’re assessing.

When you click through from our site to a retailer and buy a product or service, we may earn affiliate commissions. This helps support our work, but does not affect what we cover or how, and it does not affect the price you pay. Neither ZDNET nor the author are compensated for these independent reviews. Indeed, we follow strict guidelines that ensure our editorial content is never influenced by advertisers.

ZDNET's editorial team writes on behalf of you, our reader. Our goal is to deliver the most accurate information and the most knowledgeable advice possible in order to help you make smarter buying decisions on tech gear and a wide array of products and services. Our editors thoroughly review and fact-check every article to ensure that our content meets the highest standards. If we have made an error or published misleading information, we will correct or clarify the article. If you see inaccuracies in our content, please report the mistake via this form.

Follow ZDNET: Add us as a preferred source on Google.

Smartphones and desktop/laptop connections have been helping people for years. A lot of times, it's nothing more than keeping things in sync. You might want to keep your contacts manageable in both places. You might want/need to transfer files from on to the other (and/or vice versa).

Smartphone-to-PC connections have been helping people for years. Many times, the benefit is nothing more than keeping things in sync. Perhaps you want to keep your contacts manageable in both places. Or you might need to transfer files from one device to the other.

Also: 3 ways to switch Linux distros without losing all your data

Or maybe -- you want to control your Linux desktop from your Android phone. All the cool kids are doing it, and I'm going to show you how it's done. 

Using the KDE Connect app on your Android device and the KDE Connect app on your desktop, you can send commands from your phone to do certain things.

For example, you may have stepped away from your computer and realized you forgot to lock it. Or maybe you need to shut down the computer, open an app, print something, or play a media file. In fact, what you can do is limited only by your imagination.

Also: I replaced Windows with Linux, and there's only one feature I miss

KDE Connect can come in very handy. Let me show you how to create your first commands to control your Linux PC from Android.

What you'll need: The only things you'll need for this are KDE Connect installed on both your Android phone and your desktop. Do be aware that, if you don't use the KDE Plasma desktop, installing KDE Connect will also install a ton of dependencies.

You can find the Android app in the Google Play Store.

You can connect your devices by way of Bluetooth or a wireless network. I prefer to go the wireless route because it offers more range and is more reliable. 

To connect your devices, open the KDE Connect sidebar on the Android app and tap "Pair new device." The pairing is straightforward, so you won't have any trouble getting it done.

If you run into trouble, you may have to disable (or alter) your firewall for these to connect.

This is a bit cumbersome, but it works. Open KDE Connect on your phone and click Run Command. This will open the correct KDE Connect window on your desktop or laptop.

There are several things you can do from the KDE Connect app.

Also: My 5 favorite Linux distros that are ready to use out of the box (no setup required)

In the "Run commands" window, click "Add command" at the top right of the window.

In the resulting window, give your command a name, and then add the command you want to run. If you're not sure what command to use, you can click the drop-down and select from the list of pre-defined commands.

There are sample commands you can add from the drop-down.

Let's say you want to create a command that will lock your desktop screen. To do that, type something like "lock screen" as the name, and then type loginctl lock-session for the command.

When finished, click Add, and you're done.

Using your newly created command is easy. Open KDE Connect on your phone, tap Run Command, then tap the command you just created from the list. You should notice that your desktop immediately locks.

Also: This is my favorite Linux distro of all time - and I've tried them all

Here's a seriously fun command to add. You can create a command that takes a screenshot of your desktop and automatically sends it to your phone. That command might be named screen to phone, and the command would be:

file=/tmp/$(hostname)_$(date "+%Y%m%d_%H%M%S").png; spectacle -bo "${file}" && while ! [ -f "${file}" ]; do sleep 0.5; done && kdeconnect-cli -d $(kdeconnect-cli -a --id-only) --share "${file}"

The command above depends on the Spectacle screenshot tool. If you don't have Spectacle installed, you can either install it or adjust the command so that it can be used on your desktop.

Also: I'm a command-line pro and this is the best terminal app I've ever used, thanks to AI

KDE Connect is a really handy tool for controlling your Linux machine remotely. I would highly recommend you give this app a try and come up with some helpful commands to add.


Source: Original Publication