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
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.