hello friends! new(ish)!
Software minimalism: Difference between revisions
>OkabeR (expanded on the rational for the unix philosophy and minimalism, adjusted the reccomandations) |
>OkabeR (Added clarification on OS selection) |
||
Line 66: | Line 66: | ||
*'''[http://alpinelinux.org Alpine Linux]''' - busybox/Linux | *'''[http://alpinelinux.org Alpine Linux]''' - busybox/Linux | ||
A lot of anons suggest Arch Linux or Debian netinst, but since both of these use a GNU userland and systemd they're not minimal | Every modern Operating system has succumbed to extreme feature creep. Research UNIX was the first and last time that simple single use tools were in wide spread use. The GNU/Linux and BSD core utils include tons of added flags that go beyond what each tool is designed to do (such as the now popular example of cat -v) but beyond that some tools have defaults that are already multi-functional in nature such as ls having columnar output by default. 9front remedies this by having lc (list columns) but even then the days of a totally complete operating system that is designed according to the Unix Philosophy are long gone (if those days even existed is a matter of debate). As such, don't think too long and hard on which operating system to use. Almost any Linux or BSD system that doesn't use the GNU core utils and SystemD is already more minimal than 99% of what is being used by the vast majority of people. | ||
A lot of anons suggest Arch Linux or Debian netinst, but since both of these use a GNU userland and systemd they're not minimal. | |||
Revision as of 22:02, 9 May 2019
Software Minimalism is a philosophy inherant to many GNU/Linux distributions and other Unix like operating systems. The purpose of this page is to help newbies and advanced users alike by defining software minimalism and giving some ideas on where to start.
Unix Philosophy
The Unix philosophy, originated by Ken Thompson, is a set of cultural norms and philosophical approaches to minimalist, modular software development. The UNIX philosophy is documented by Doug McIlroy in the Bell System Technical Journal from 1978:
- Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features".
- Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.
- Design and build software, even operating systems, to be tried early, ideally within weeks. Don't hesitate to throw away the clumsy parts and rebuild them.
- Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them.
This is often summarized as:
- Write programs that do one thing and do it well.
- Write programs to work together.
- Write programs to handle text streams, because that is a universal interface.
Justification for Minimalism
By Following the Unix Philosophy we can:
- Make code that is easier to write and maintain
- Facilitate easy scripting and automation
- Decrease bugs in a code base
- decrease vulnerabilities and remove attack vectors in our software
- Become overall more efficient
The power of unix is the power of the pipe and console redirection:
$ gunzip -dc file.tgz | tar xf - $ cat /foo/bar.txt | grep "string" $ bunzip2 < image.ff.bz2 | lel $ bunzip2 < image.ff.bz2 | ff2png > sxiv $ audio/mp3dec <foo.ogg >/dev/audio #(pulled from 9front audio(1) man page) $ cat foo bar baz > foobarbaz $ echo "append this text" >> foo $ echo "overwrite with this text" > foo $ cat foo.ps > /dev/lpt #to print on an lpt printer
For a more indepth explaination read Program Design in the UNIX Environment
Minimalism Rules of thumb
A system cannot be minimal if it uses:
- poetteringware or any freedesktop maintained software, this includes:
- pulse audio
- systemd
- dbus
- wayland
- Gnome and GTK
- KDE
- GUI based tools
- programs written in interpreted languages
- programs written to use XML
- Any of the GNU tools
- it is listed at https://suckless.org/sucks/ or as harmful under https://harmful.cat-v.org/software/
And always remember, just because it runs in a terminal doesn't make it minimal!
Minimal Operating Systems
Although strictly speaking every BSD and GNU/Linux distro isn't nearly as minimal as described in Program Design in the UNIX Environment here are some Operating Systems that get close.
- 9front - This is the closest thing to Program Design in the UNIX Environment tier minimalism
- OpenBSD
- Void Linux - especially if using the musl version
- CRUX
- /g/entoo - can be made as minimal as you want it to be
- Alpine Linux - busybox/Linux
Every modern Operating system has succumbed to extreme feature creep. Research UNIX was the first and last time that simple single use tools were in wide spread use. The GNU/Linux and BSD core utils include tons of added flags that go beyond what each tool is designed to do (such as the now popular example of cat -v) but beyond that some tools have defaults that are already multi-functional in nature such as ls having columnar output by default. 9front remedies this by having lc (list columns) but even then the days of a totally complete operating system that is designed according to the Unix Philosophy are long gone (if those days even existed is a matter of debate). As such, don't think too long and hard on which operating system to use. Almost any Linux or BSD system that doesn't use the GNU core utils and SystemD is already more minimal than 99% of what is being used by the vast majority of people.
A lot of anons suggest Arch Linux or Debian netinst, but since both of these use a GNU userland and systemd they're not minimal.
Window Managers
See also: Desktop environment#Window Managers where the following is sourced from
Currently most GNU/Linux and BSD distributions use the X Window System for drawing the desktop. It is designed to be modular and highly customizable. One of the results of this design is that X.org doesn't manage windows. Instead it depends on a special client application called a window manager. The window manager (WM in short) moves and resizes windows, among other things, often in response to user input. Window managers also do much more, like automatic window layout, compositing, drawing decorations, drawing panels, providing multiple workspaces, and so on.
Window managers can be divided into these three categories:
- Stacking - They allow windows to draw their contents one on top of another on the desktop, starting with the one on the bottom and going up in the "Z order".
- Compositing - Provide a buffer for each window to draw on and then compose those buffers together creating the desktop image. This type of window manager allows use of semitransparent windows.
- Tiling - The windows do not overlap.
- Static tiling WMs such as ratpoison always use a set number of equal size tiles, and the tiles do not move
- Dynamic tiling WMs such as awesome allow you to change the layout of the tiles, the number of tiles onscreen, and other things. it should be noted that awesome also has a stacking mode in addition to many tiling configurations.
Many WMs contain both stacking and tiling modes, and the behavior can be switched by the user.
Finally, there are also composite managers such as xcompmgr that work together with a non-compositing WM making it compose windows, allowing for effects such as transparency and drop shadows.
Bloat
- Dynamic
- Awesome - Despite looking pretty bad of the box, it's a very popular tiling window manager. It is completely scriptable in Lua, which makes it one of the most powerful and customizable window managers once you get around to programming the configuration file.
- i3 - One of the most popular window managers around, i3 is a fork of wmii that strives to fix the latter's convoluted code and documentation problems. Looks good out of the box and the configuration is simple and intuitive. It also provides a great amount of documentation on the webpage. Good for beginners and developers/hackers alike.
- Compositing
- Compiz - A compositing WM being developed since 2006. It uses OpenGL (AIGLX). It is know for having a lot functionality and providing many interesting effects. However, it can cause problems if the graphics are faulty.
- KWin - A compositing WM used in KDE. It's comparable in feature set to compiz.
- Mutter - The default window manager for GNOME.
- Xfwm - The default window manager for XFCE.
Minimal
- Dynamic
- DWM - Doesn't come with a simple configuration file; instead, you're supposed to edit config.h and recompile dwm yourself. At least they make an effort to keep the code well-commented and under 2000 SLOC. Not for beginners as they themselves claim to want to "keep the userbase small and elitist", though you might want to give this a shot if you know C and you're willing to hack into the source code.
- monsterwm - Tiny but monstrous! Currently under 700 lines of code including the configuration file.
- Tiling
- Stacking
- Windowmaker - No-frills, very lightweight, fast. Makes your computer look like a mid-90s NeXTSTEP workstation.
- 2bwm - Experimental "floating" WM that is only 342K
- rio - default WM for plan9
- Compositing tools (for stacking/tiling WMs)
- Compton - Forked of Xcompmgr size is only 255K
There are also some anons who skip the GUI all together and do everything in framebuffer
For some more information on this topic, see: this page.
Display Managers
A display manager is what might typically be thought of as a "bloat". It will prompt you to enter a username to log in as, as well as specify a session to be used, in an inefficiant and bloated way. Use startx from a tty instead.
Screensavers
slock or none at all
What does /g/ use?
A common minmal configuration which can be seen among /g/ users in minimalism threads usually features some of the software below. For the mo st part everything is TUI
- Distro: Gentoo, OpenBSD, Void Linux, CRUX GNU/Linux, 9front, or Alpine Linux);
- Userland: busybox statically linked, suckless core (ubase, sbase, 9base) statically linked;
- Window Manager: DWM, rio, or TTY;
- Login/Display manager: startx;
- File Manager: Sometimes noice, nnn, or LF, standard Unix utils like ls, cp, mv, etc.;
- Terminal Emulator: st;
- Web Browser(note: web is bloat): surf, lynx, netsurf, w3m, cURL;
- gopher: lynx, sacc, or hURL;
- Shell: mksh or dash;
- OS information: they all rely on bash as a dependancy;
- Screen lock/saver: slock;
- Music player: mpd + mpc, or cmus;
- Video player: mpv or ffplay (part of ffmpeg);
- IRC client: weechat or irssi;
- Screen capture (screenshot): scrot or import (part of imagemagick);
- Image viewer/desktop wallpaper display: lel, feh, or sxiv and hsetroot;
- PDF Viewer: zathura using the mupdf backend, or better yet to view PostScript or DjVu files, mupdf;
- Video conversion: FFmpeg (including WebM or GIF creation);
- Text editor: acme (boarderline bloat), Vim (boarderline bloat), neovim (better), Vis (best), or sam, Nano (if you don't need/want a modal editor);
- Document creation: {g,t}roff, markdown;
- Other: doas (opendoas package on void) in place of sudo, factotum in place of PAM.
External Resources
bitreich gopher hole, the infinitely more lulzy bitreich website