Cooking Linux the right way: use cases the Unix-way

Preface

In the case of modern Linux you have several options to choose your use case:

  • Windows-like (I don't mean it's bad), when you manipulate normal GUI windows using mouse and hotkeys
  • Terminal-based, when you do everything in the command line and CLI apps
  • Tiled, when you have GUI windows, but they are tiled or maximized and managed using hotkeys only
  • Emacs-based, when you try to do inside Emacs as much as you like and Emacs manages its windows

You are welcome to use a mix, I do it, by the way. It's the question of comfort and your use cases. For example, when I edit audio, I use GUI apps only and I prefer a Windows-like approach, but when I edit the text I use as Emacs, as a command line in the Terminal. You are welcome to mix and try, you even don't need the virtual machine for that because for major distributions everything works well on the same installation. What's important, is that you have a choice. In the Linux world, however, those who like tiled environments speak more for some reason, but it doesn't reflect the percentage of users, who use each approach on the desktop. OK, let's move on.

Windows-like

That's what traditional desktop environments are about: windows, windows titles, you move them and resize them with the mouse. What I like about Gnome, is that it has some tiling capabilities, I mean you can divide the screen into two parts, and sometimes it's useful. But I use a notebook with a 13-inch display, if you have a bigger screen you may need to tile more than two apps. So, it becomes a pain. I also like to work on one task at a time and a thus bigger screen will not fix my issues. :)

The problem with a Windows-like environment is context switching, all the programs look different and the brain doesn't adapt well to it. You lose time and concentration, but it may be not so critical for you. It's also a productivity loss when you take an arm off the keyboard and start looking for a menu item with a mouse.

Regarding particular desktop environments, I don't like KDE, because it had memory leakage problems. XFCE is supposed to be a lightweight Gnome version, but it becomes almost as heavyweight as Gnome, but lacking some important features. So, choosing XFCE or Gnome is a matter of taste and functionality. For example, XFCE doesn't support Wayland at the moment and Wayland is good. If you need to be lean with your system resources, you can try LXDE or LXQt, as they have maximum functions with a minimal CPU and memory footprint. It's also for X Windows system, regretfully.

In a Windows-like environment, you can use workspace and hotkeys to switch between them. To become more productive with my workspace, I use the following rules:

  • A fixed number of workspaces (3), each with a specific purpose
  • Launch most apps on login automatically and place them on workspaces automatically as well
  • Do not move apps between workspaces

Be sure to use hotkeys everywhere you can, because a keyboard is a lot faster than a mouse. :)

Terminal

This is an extreme environment because it's text only and not so comfortable regarding user experience. Most terminal emulators lack GPU acceleration, so they lack smooth rendering. As everything is controlled with a keyboard and resource usage is minimal, it's the fastest way to get the job done if you have CLI apps only. No context switching, by the way. It becomes so comfortable over time, that you tend to evade GUI apps. But beware, people use Twitter and send images and links inside emails. :)

It's a good idea to master the command line anyway for the following reasons:

  • Some things can be done significantly faster
  • Some things in Linux still can't be done using GUI
  • If a remote server has SSH access only, your options are limited to CLI

The next (but in fact really old) chapter in CLI evolution is terminal multiplexors like Screen and Tmux. They allow you to have windows (and tile them) and sessions, so you can save and restore several programs with some files opened for a specific use case, but only if they are CLI. :) Vim or NeoVim is a great CLI program, really a handy editor. You may want to change the color scheme or some key bindings, but generally, when you get its commands at your fingertips, it becomes extremely comfortable. It has a file manager and some programs try to use Vim bindings, even Chrome extensions. And in terminal font sizes are always the same, it matters when you work a lot at a computer, reducing fatigue.

Tiled

A tiled environment is good for big screens and looking at several apps at the same time. I don't have these use cases, so I just use maximized apps. Tiled environments have several drawbacks for me, though:

  • Tiling window managers don't support Wyland
  • They are window managers, so they lack DE features: hardware controls and small useful programs I need

People say that you can invest your time to get a more productive environment, you can also save configs to the cloud and install them fast on a new system. Well, for me it looks like you are studying ergonomics yourself and I don't consider it a good investment of time. I also can't understand why to set up things like hardware controls, that are present in the default Gnome.

Emacs

What do you expect from a text editor? Nice hotkeys, syntax highlighting, fast editing, maybe macros support. Emacs is not a text editor at all, it is an "elisp code execution environment" (C). That means that any logic within Emacs can be customized and any program can be written inside Emacs. By the way, Emacs has a text-only version, but it's slow and sometimes it behaves strangely. Links insertion for me is a critical case: I'd like to have markup done automatically for links. Emacs does this in a series of questions like URL, link text, and link title. Vim wiki, for example, just inserts some markup and you move left or right to make a link actually. Emacs is really old and when you ask for anything text-based it's usually inside Emacs:

  • Markdown mode
  • HTML mode
  • Org-mode is like an internal wiki, which you can export to any format
  • Split screen mode when you need to translate the text

So, in any mode Emacs behaves differently and the same events trigger different functions, and... it's so nice! At first, I was dissatisfied that the editor does something for me, like closing brackets. But then I relaxed and liked it because it works and it does the most important things in every mode.

And yes, Emacs has windows (called buffers) inside and a file manager. You can also use its terminal emulator, RSS reader, and Telegram client, but for me, it's overkill. For example, I write an article for this blog, run the update command, then several git commands in the terminal and I don't experience problems switching between Emacs and Terminal. Besides, Gnome Terminal is really good. :)

Just as a conclusion for Emacs it's worth trying and I'll mention a few essential customizations to an empty Emacs config file in the next article.

Conclusions

Just to sum up:

  • Use windows-like environments for graphics-intensive programs
  • Use a terminal environment if all your programs are CLI
  • Use a tiled environment if you need to look at several activities at once
  • Use Emacs if you need more automation and customization

Let's move to Emacs then. :)

@Konstantin Ovchinnikov
Tags: #linux #productivity

Comments