2020-04-09

minimalistic gnu/linux system setup and usage examples

for software used see software-list

graphical user interface

the tiled window manager dwm handles the arrangement of xserver windows. desktop-example.png. with configurations to remove borders and set the font.

little "clock" in the top right corner that shows the day of the year, the day of the week and the current daytime in utc+0 kiloseconds. it is regularly updated by a background script with xsetroot -name "content"

terminal

st started with a screen session. st -e screen. with the screen functionality, ctrl+c creates new terminal buffers, ctrl+a n and ctrl+a n switch between them. using this, a terminal emulator that supports tabs is not necessary. font: "Gohu GohuFont:pixelsize=14:antialias=false"

starting programs

xbindkeys to bind the most important commands to f keys. for example f1 is the web browser, f2 the file manager, f3 the terminal. f5 opens dmenu, a line appearing at the top of the screen to enter a program name to be run

~/.xbindkeysrc.scm

(xbindkey (quote (F1)) "firefox")
(xbindkey (quote (F2)) "thunar")
(xbindkey (quote (F3)) "st -e screen")
(xbindkey (quote (F5)) "dmenu_run")
(xbindkey (quote (F9)) "screenshot")

other programs are started using dmenu_run on f5

right click commands in the file manager

  • group: move selected files into a new or existing directory whose name is entered in a dialog
  • splice: move all files in selected directories to the current directory and remove the directories, automatically handling conflicting filenames
  • sort files for the sake of rating into numeric directories: mv 1/artist-name/album-name to 2/artist-name/album-name
  • collect-file: link selected files into $HOME/collections/yyyy-mm-dd
  • add resolution tags to video files: 1080p.8ks.myvideo.mkv
  • move up: move selected files one directory up
  • tag-add and tag-remove: add dot separated tags to filenames before the filename extension
  • delete-if-empty: delete empty selected files and directories recursively

login

boot goes to the tty console login with disabled cursor blinking (how to turn that off, there is an aur package for that). when logging in, a luks container for /home or /home/.{username} is decrypted and mounted to /home/{username} with the use of pam_mount. then ~/.bash_profile starts the xserver

~/.bash_profile

if [ "$(tty)" == /dev/tty1 ]
then
  exec startx
fi

~/.xinitrc

emacs --daemon
xmodmap /home/nonroot/.xmodmap
xbindkeys &
st -e screen &
restart-on-end -n 2 -- dwm

emacs is started in daemon mode so the slow startup happens only once and buffers are opened fast with emacsclient -tc which is set in $EDITOR and there is a shell script named e

#!/bin/sh
# pass all arguments to the editor program configured with the $EDITOR environment variable

$EDITOR "$@"

users

especially on single user systems i use a generic nonroot user. saves having to invent names, memorise them, rename them or keep them up to date on different systems

linux distribution

archlinux, because among other reasons

  • it keeps packages as they are made by upstream. not like debian, which makes extensive changes to programs to make them debian specific and require debian dependent knowledge
  • comes installed with a minimum
  • always get the current version of packages, that went through a public testing phase in a testing repository. avoids having to manually compile things because you need a version that is already six months old and not in the repositories for your distribution version that will never be updated. on ubuntu you might spent a lot of time searching and compiling newer version of software yourself, for example new drivers and kernels if you bought a new graphics card. also avoids risky full distro upgrades, they just do not exist because the system updates gradually with each package update. manual intervention is rarely required, and if then only on important big changes like the switch to systemd or demanded by upstream developers of the used software
  • the package manager is a relief, in comparison to apt-get/apt-cache/dpkg. finally an efficient to use program that is fast and gives terse and clear output. packages are very easy to create, the only thing needed is basically a bash script that does the compile and installation steps. users can upload packages to the separate arch user repository. official packages are signed
  • on one workstation i have been running the same arch system for 8 years, which started as a 32bit system and was in-place converted to 64bit. arch can also be in-place converted into parabola linux, which is fsf endorsed

versioned system configuration

stored in a git repository with a file structure like this

data
  {hostname} ...
    {root-relative-full-paths}

symlinked to target destinations with "cp -rst / $PWD/data/hostname/*"

shell configuration

a simple prompt on its own line in magenta color that includes the basename of the current working directory

~
  echo test
test
~
  cd /usr/bin
bin
  ls guile
guile
bin

keyboard layout adjustments

xmodmap to make the right shift-key work as the meta key for emacs and to disable the shift-lock key

~/.xmodmap

remove Lock = Caps_Lock
keysym Caps_Lock = Super_L
remove shift = Shift_R
add mod1 = Caps_Lock Shift_R
remove mod1 = Alt_L Alt_R
! add control = Alt_L Alt_R

a custom x11 keyboard-layout for the qgmlwb layout is used and a dead-key (a key that only modifies a subsequent key) for diaresis is on the circumflex key

virtual machines

qemu is free software and does not need additional kernel version dependent modules like virtualbox. such modules need to be recompiled for each kernel update, which happen every few weeks, and if a compatible version is not yet available then you are out of luck and would not be able update the kernel. the qemu instance is set up to offer a vnc interface, which also works at boot time. "remmina" is then used to connect to the virtual machines. network bridging and external hardware can be more difficult to set up, but less so in newer versions

gtk style

~/.config/gtk-3.0/settings.ini

[Settings]
gtk-button-images=0
gtk-cursor-blink=false
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-font-name=Monospace 11
gtk-icon-theme-name=HighContrast
gtk-menu-images=0
gtk-theme-name=B00merang-Blackout
gtk-toolbar-icon-size=GTK_ICON_SIZE_SMALL_TOOLBAR
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium

~/.gtkrc-2.0

gtk-theme-name="B00merang-Blackout"
gtk-icon-theme-name="HighContrast"
gtk-font-name="Monospace 11"
gtk-cursor-theme-name="Adwaita"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_SMALL_TOOLBAR
gtk-button-images=0
gtk-menu-images=0
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintmedium"