You can control your Linux PC from your Android phone – here’s how

by
0 comments
You can control your Linux PC from your Android phone – here's how

Jack Wallen/Elyse Batters Picaro/ZDNET

Follow ZDNET: Add us as a favorite source On Google.


ZDNET Highlights

  • KDE Connect allows you to do many things.
  • With this remote app you can send commands to Linux.
  • There’s no limit to what you can do with this feature.

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

Smartphone-to-PC connection has been helping people for years. Many times, the benefits are nothing more than keeping things in sync. Perhaps you want to keep your contacts manageable in both places. Or you may need to transfer files from one device to another.

Too: 3 Ways to Switch Linux Distros Without Losing All Your Data

Or Perhaps –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.

What can you do with this feature?

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 walked 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.

Too: I replaced Windows with Linux, and there’s only one feature I miss

KDE Connect can be very useful. Let me show you how to create your first command to control your Linux PC from Android.

Creating your first command

what you’ll need: The only thing you need for this is to have KDE Connect installed on both your Android phone and desktop. Keep in mind that, if you don’t use the KDE Plasma desktop, installing KDE Connect will also install a lot of dependencies.

you can find android app In Google Play Store.

You can connect your device via Bluetooth or wireless network. I prefer to go the wireless route because it offers greater 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 making it.

show more

kde connect

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

Screenshot by Jack Wallen/ZDNET

It’s a bit cumbersome, but works. Open KDE Connect on your phone and click on Run command. This will open the correct KDE Connect window on your desktop or laptop.

show more

KDE Connect.

You can do many things with the KDE Connect app.

Screenshot by Jack Wallen/ZDNET

Too: My 5 Favorite Linux Distros That Are Ready To Use Out Of The Box (No Setup Required)

In the “Run Command” window, click “Add Command” at the top right of the window.

show more

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

show more

kde connect

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

Screenshot by Jack Wallen/ZDNET

Let’s say you want to create a command that will lock your desktop screen. To do this, type something like “Lock Screen” as the name and then type loginctl lock-session to the order.

When finished, click Add and you’re done.

Using your new order

Your newly created command is easy to use. 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 locks immediately.

kde connect

I’m about to tap out from my desktop.

Screenshot by Jack Wallen/ZDNET

Nice, eh?

Too: This is my all-time favorite Linux distro – and I’ve tried them all

Other commands you can add include:

  • shutdown – systemctl poweroff
  • reboot – systemctl reboot
  • suspend – systemctl suspend
  • unlock screen – loginctl unlock-screen

Here’s a really fun command to add. You can create a command that takes a screenshot of your desktop and automatically sends it to your phone. The name of that command could be From screen to phone, And the order will be:

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

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

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

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

Related Articles

Leave a Comment