2023-08-05

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 (screenshot), configured to draw no borders and a monospace font.

cursor blinking disabled for gtk2.0 and gtk3.0.

terminal

st with a screen session. st -e screen. 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"

important commands

  • search: search for files containing a list of keywords and display file names
  • searchl: search for files containing a list of keywords and display matching lines and filenames
  • replacer: replace strings in text files
  • ea: opens files in the emacs instance in the background. an emacs client is open in another screen window
  • see also sph-script

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

  • collect-file: symlink (same filesystem) or copy (different filesystem) selected files into $HOME/collections/yyyy-mm-dd
  • delete-if-empty: recursively delete empty files and directories
  • group: a dialog pop-up and selected files ar moved in a new or existing directory with the given name
  • move-up: move selected files into the parent directory
  • prepend-video-tags: prepend resolution and framerate to video file names: 1080p60.video.mkv
  • rate 1, rate 2, rate 3, rate 4, and rate 5: for moving files and directory structures under numeric rating directories
  • splice: files of the selected directories are moved into the current directory and the selected directories are removed. duplicate file names are automatically renamed
  • unpack: unpack archives with the unp utility

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 partition or file /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-theme-name=Windows-10-Dark
gtk-icon-theme-name=HighContrast
gtk-font-name=Cantarell 11
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-cursor-blink = false
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_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

~/.gtkrc-2.0

[Settings]
gtk-theme-name=Windows-10-Dark
gtk-icon-theme-name=HighContrast
gtk-font-name=Cantarell 11
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-cursor-blink = false
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_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