THE PHOTON SPHERE

xmonad with xterm+screen and Termonad

In the past I have used the xmonad tiling window manager but eventually returned to KDE, because I had some problems with truncated text in terminal windows, needed to be able to run a complicated GUI that was not very suited for a tiling window manager and I thought there was not that much difference in performance.

xmonad, xmobar

Introduction

The documentation reads that the xmonad tiling window manager is fast and configurable; xmobar - a minimalistic status bar.

terminal emulator

xterm

The xterm terminal emulator starts up very quickly and for me this compensates for its lack of tabs (update: see Termonad below).

text truncation

If an xterm window is small in size and later resized to a bigger window the output is truncated instead of reflowed. This has always been a big nuisance to me, but I didn’t manage to find a solution earlier.

screen

If in the xmonad.hs configuration file the following code is used to define a terminal with the screen command then the text in the window is no longer truncated and reflows in a resized window.

myTerminal :: String
myTerminal = "xterm -e \"exec screen\""

myFloatingTerminal :: String
myFloatingTerminal = "xterm -title \"floatterm\" -e \"exec screen\""

--...

keysAdditional =
    [ ("M-C-<Return>", spawn myFloatingTerminal)
    ,

-- ...
  xmonad $ def {
    terminal = myTerminal,

detached screens

There is changed behaviour however. Because all terminals now run automatically with a screen command and will continue to execute even when killed with e.g. a M-<Backspace>, they can become detached.

keysAdditional =
      [...
       , ("M-<Backspace>", kill)

With a screen -ls screens are listed. I have aliases to list screens and detached screens only, and a to reattach to a detached screen.

aliases

The definitions for screen aliases are given below:

alias r="screen -DR"
alias s="screen -ls"
alias z="screen -ls | grep '(Detached)'"

Simply reattach to a detached screen by its listed name and use an exit command or Ctrl-D to exit and terminate it.

Termonad

Update: revisiting the Termonad terminal emulator, which is indeed blazingly fast and also has tabs! (Distrotube video here). I’m now using Termonad (again) and the above text on xterm only applies to my floating terminals.

Installing vanilla Termonad under NixOS from GitHub: cdepillabout/termonad, using commands given below:

mkdir -p ~/lib
cd ~/lib
git clone https://github.com/cdepillabout/termonad
cd termonad
nix-build

The build results is under the result subdirectory, so a symbolic link can be created for it, as follows:

mkdir -p ~/bin
cd ~/bin
ln -s /home/mdo/lib/termonad/result/bin/termonad

You can edit e.g. your ~/.bashrc to add ~/bin to your PATH (or simply specify the full path in your xmonad.hs configuration file.

xmonad.hs:

myTerminal :: String
-- myTerminal = "xterm -e \"exec screen\""
myTerminal = "~/bin/termonad"

myFloatingTerminal :: String
myFloatingTerminal = "xterm -title \"floatterm\" -e \"exec screen\""

Performance gains

My system is indeed significantly snappier and faster in general under xmonad than it was under KDE and I now don’t quite understand how I came to a different conclusion before. It must have been annoyance-bias over the terminal output truncate problem.

dotfiles

My dotfiles at GitHub with a.o. xmonad, xmobar and Termonad configuration.

Already on GitHub