Make Android devices part of your Linux environment
Symbiotic Combo
An Android smartphone or tablet is a versatile device on its own, but with a bit of work and few apps, you can make it an organic part of your Linux-based working environment.
Although an Android device can function autonomously, integrating it into your Linux-based environment can make your daily computing more efficient. Several apps and tools are available to help you to make an Android-based smartphone or tablet fit your workflow.
Mirroring Notifications with LinConnect
Viewing Android notifications on your Linux desktop is less distracting and time-consuming than checking your device every time it vibrates or blinks. The LinConnect [1] tool lets you add this functionality easily to any Linux desktop machine, as long as it's on the same wireless network as the Android device (Figure 1).
LinConnect comprises the service that runs on the Linux desktop and the Android client app. The server component is written in Python and has only a few dependencies. If you happen to use Ubuntu, you can deploy and run the LinConnect server using the following commands:
wget --quiet https://raw.github.com/hauckwill/linconnect-server\ /master/LinConnectServer/install.sh chmod +x install.sh ./install.sh
On other Linux distributions, you can deploy the LinConnect server by installing the required dependencies and cloning the project's GitHub repository with:
git clone https://github.com/hauckwill/linconnect-server.git
Now, switch to the ~/.linconnect-server/LinConnectServer/main
directory and start the server using python linconnect_server.py
. Next, install the LinConnect app [2] on the Android device. Launch the app and pick the machine running the LinConnect server from the list of available servers. This step connects the app to the machine and sends a test notification to the desktop.
KDE Connect
If KDE is your preferred graphical desktop environment, KDE Connect [3] is the best tool for linking it to your Android device. Similar to LinConnect, KDE Connect comes in two parts: a desktop application and an Android app. The binary packages of the desktop component are available for various Linux distributions like openSUSE and Ubuntu (and all its variants). If you use the latter, you can install the latest version of KDE Connect from a PPA [4] using:
sudo apt-add-repository ppa:vikoadi/ppa sudo apt-get update sudo apt-get install kdeconnect
KDE Connect for Android is available on both the Google Play Store and F-Droid, so you can install the app from your preferred source. Once you've done that, launch the KDE Connect application on the KDE desktop and the app on your Android device. Then, pair the desktop client with the detected Android device, and you are good to go.
All functionality in KDE Connect is implemented via plugins, and you can enable and disable individual modules as well as configure their options using the KDE Connect desktop application (Figure 2). In addition to plugins for mirroring and syncing notifications, KDE Connect offers several other useful modules.
The Battery monitor plugin, for example, allows you to keep an eye on the Android battery status from the convenience of the KDE desktop. To make use of this plugin, you need to add the KDE Connect widget to the desktop. The Clipboard plugin enables the functionality that syncs the contents of the desktop and Android clipboards. With the Remote filesystem browser plugin enabled, you can use the Dolphin file manager to access storage on the Android device.
The Share and Receive module makes it possible to exchange files between the desktop and the Android device. You can push any file on your desktop machine by right-clicking on it in Dolphin and choosing Send to <DEVICE> via KDE Connect. You can send files in the opposite direction, too. The KDE Connect app adds a dedicated command to Android's sharing feature, so you can push a file from practically any app. KDE Connect's sharing functionality is not limited to files: You can send URLs from the Android device to the default browser on the KDE desktop (Figure 3).
If you want to use your Android device to control the media player on the KDE desktop, enable the Multimedia Control Receiver plugin to start, stop, pause, and navigate between tracks using a remote control interface in the KDE Connect app (Figure 4). Finally, the Touchpad plugin turns the Android device into a glorified touchpad for controlling the desktop cursor.
SSH Button and Mercury-SSH Commander
When you are on the move, an Android device can come in rather handy for accessing and managing remote Linux machines via SSH. Several excellent SSH client apps can help you with that, including ConnectBot, VX ConnectBot, and JuiceSSH. However, pecking commands on a tiny virtual keyboard can quickly become a nuisance – especially if you usually run only a handful of specific actions (e.g., perform a system update, restart a service, reboot the remote machine, etc.).
In this case, you might want to opt for an app like SSH button [5], which lets you define multiple buttons with commands attached to them (Figure 5). As you would expect, defining buttons in SSH button is as easy as it gets: choose Add entry from the main menu, give the new button a name in the Label field, specify the desired command in the Command field, and provide the required SSH connection info. The Command field can contain practically any Linux command – from a simple sudo reboot
to more complex commands like
sudo apt-get update && sudo apt-get dist-upgrade -y
Although SSH button is available free of charge, it's not open source. If you prefer to stick to pure open source software, Mercury-SSH Commander [6] is right up your alley. This application also allows you to define an unlimited number of entries with specific commands assigned to them. Instead of using the app itself, however, you need to create a configuration file manually in JSON format containing definitions. Fortunately, this is easy to do, and you can use the example shown in Listing 1 as a starting point:
Listing 1
Configuration File for Mercury-SSH Commander
As you can see, the configuration file is relatively simple. The name
, host
, port
, user
, and password
server properties are used to specify the SSH connection info. All commands are specified in the commands
array, and each command has three properties: name
, sudo
(specifies whether the command should be run as root), and cmd
.
The configuration file must be saved as a UTF-8, UTF-16, or UTF-32-encoded text file with the .json
extension in the Mercury-SSH
directory on the Android device. Mercury-SSH Commander supports multiple configuration files, so you can create individual profiles for several remote machines (Figure 6).
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
There's a New Open Source Terminal App in Town
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.