It seems to me there are two camps when it comes to the Raspberry Pi. Some people use them as little PCs or even laptops with a keyboard and screen connected. But many of us use them as cheap Linux servers. I’m in the latter camp. I have probably had an HDMI plug in a Pi only two or three times if you don’t count my media streaming boxes. You can even set them up headless as long as you have an Ethernet cable or are willing to edit the SD card before you boot the machine for the first time.
However, with the Raspberry Pi 4, I wanted to get to a desktop without fishing up a spare monitor. I’ll show you two ways to get a full graphical KDE desktop running with nothing more than a network connection.
The same principle applies to most other desktop environments, but I am using KDE and Ubuntu on the Pi, even though something lighter would probably perform better. But before we get there, let’s talk about how X11 has had a big identity crisis over the years.
There are many ways to remotely access X programs, many of which are rarely used today. However, for this purpose, we are going to use SSH tunneling along with some special tricks to get the entire desktop running. It is easy to just run a single X program over SSH, and you’ve probably done that often. If so, you can skip to the next section.
Continue reading “Linux Fu: Raspberry Pi Desktop Headless”
If you’re the kind of person who likes small and cheap Linux devices, you’re definitely alive in the perfect moment in history. It seems as if every few months we’ve got another tiny Linux board competing for our pocket change, all desperate to try to dethrone the Raspberry Pi which has already set the price bar exceptionally high (or low, as the case may be). We’ve even started to see these Linux boards work their way into appropriately cheap laptops, though so far none have really made that great of an impression.
But thanks to the efforts of Blue Systems and Pine64, the situation might be improving: they’ve worked together on a build of KDE Neon for the $99 Pinebook. The fact that they’ve gotten Plasma, KDE’s modern desktop environment, running on the rather mediocre hardware at all is an accomplishment by itself. But they’ve also set out tailor the entire system for the Pinebook, from the kernel and graphics drivers all the way up to Qt and Plasma tweaks.
In a blog post announcing the release candidate of the OS, Neon developer [Jonathan Riddell] says that these top-to-bottom improvements show that you can turn a super cheap Linux laptop into a practical computer if you’re willing to really get in there and optimize it. He also says the project has been something of a two-way street, in that improvements made for the Pinebook build have also been applied to upstream development.
The last time we looked at the Pinebook, we came away cautiously optimistic. It wasn’t great, but it was about as good as you could possibly expect given the price. If more developers are willing to go out on a limb and start optimizing their software for the device, it might become a very promising platform for low-cost mobile hacking.
Text-based Linux and Unix systems are easy to manipulate. The way the Unix I/O system works you can always fake keyboard input to another program and intercept its output. The whole system is made to work that way. Graphical X11 programs are another matter, though. Is there a way to control X11 programs like you control text programs? The answer to that question depends on exactly what you want to do, but the general answer is yes.
As usual for Linux and Unix, though, there are many ways to get to that answer. If you really want fine-grained control over programs, some programs offer control via a special mechanism known as D-Bus. This allows programs to expose data and methods that other programs can use. In a perfect world your target program will use D-Bus but that is now always the case. So today we’ll look more for control of arbitrary programs.
There are several programs that can control X windows in some way or another. There’s a tool called xdo that you don’t hear much about. More common is xdotool and I’ll show you an example of that. Also, wmctrl can perform some similar functions. There’s also autokey which is a subset of the popular Windows program AutoHotKey.
Continue reading “Linux Fu: X Command”