We are still actively working on the spam issue.

Difference between revisions of "Software minimalism"

From InstallGentoo Wiki
Jump to: navigation, search
Line 15: Line 15:
 
* Write programs to work together.
 
* Write programs to work together.
 
* Write programs to handle text streams, because that is a universal interface.
 
* Write programs to handle text streams, because that is a universal interface.
 +
 +
==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 most part everything is TUI
 +
 +
NOTE: Examples here are based on the least bloated option available if no other alternatives exist.
 +
 +
* Distro: [[Gentoo]], [[OpenBSD]], [https://voidlinux.org Void Linux], [http://crux.nu CRUX] GNU/Linux, [[9front]], or [http://alpinelinux.org Alpine Linux]);
 +
* Userland: busybox statically linked, [https://git.2f30.org/hbase/log.html hbase], [http://core.suckless.org/ suckless core] (ubase, sbase, 9base) statically linked;
 +
* Window Manager: [https://dwm.suckless.org DWM], rio, or TTY;
 +
* Login/Display manager: sx [https://clbin.com/MJdl9 edited version to use with sbase tty(1)];
 +
* File Manager: Sometimes [http://git.2f30.org/noice/ noice], [https://github.com/jarun/nnn nnn], or [https://github.com/gokcehan/lf LF], standard Unix utils like ls, cp, mv, etc.;
 +
* Terminal Emulator: [https://st.suckless.org/ st];
 +
* Web Browser(note: web is bloat): [https://surf.suckless.org surf], [https://lynx.invisible-island.net/ lynx], [http://netsurf-browser.org netsurf], w3m, cURL;
 +
* gopher: [https://lynx.invisible-island.net/ lynx], [git://bitreich.org/sacc/ sacc], or hURL;
 +
* Shell: [https://www.mirbsd.org/mksh.htm mksh] or [http://gondor.apana.org.au/~herbert/dash/ dash];
 +
* OS information: they all rely on bash as a dependancy so just write you own or use ufetch if you run void;
 +
* Screen lock/saver: [https://tools.suckless.org/slock slock];
 +
* Music player: [http://www.musicpd.org/download.html mpd] + [https://www.musicpd.org/clients/mpc/ mpc], or [https://cmus.github.io/ cmus];
 +
* Video player: [http://mpv.io/ mpv] or ffplay (part of ffmpeg);
 +
* IRC client: [http://www.weechat.org/download/ weechat], [http://www.irssi.org/download irssi], [https://github.com/c00kiemon5ter/iii iii], [http://tools.suckless.org/ii/ ii],erc;
 +
* Screen capture (screenshot): [http://scrot.sourcearchive.com/ scrot] or [http://www.imagemagick.org/script/install-source.php#unix import] (part of imagemagick);
 +
* Image viewer/desktop wallpaper display: [https://github.com/younix/lel lel], [http://feh.finalrewind.org/ feh], or [https://github.com/muennich/sxiv sxiv] and [https://github.com/himdel/hsetroot hsetroot];
 +
* PDF Viewer: [https://pwmt.org/projects/zathura/ zathura] using the mupdf backend, or better yet to view PostScript or DjVu files, [https://mupdf.com/ mupdf];
 +
* Video conversion: [http://www.ffmpeg.org/ FFmpeg] (including WebM or GIF creation);
 +
* Text editor: [http://acme.cat-v.org/ acme] (boarderline bloat), [http://www.vim.org/ Vim] (boarderline bloat), [https://github.com/neovim/neovim neovim] (better), [https://github.com/martanne/vis Vis] (best), or [http://sam.cat-v.org/ sam], [http://www.nano-editor.org/ Nano] (if you don't need/want a modal editor), Emacs
 +
* Document creation: {g,t}roff, markdown;
 +
* Other: [https://github.com/multiplexd/doas doas] (opendoas package on void) in place of sudo, 9front or plan9 and [http://man.cat-v.org/plan_9/4/factotum factotum] in place of Linux and PAM.
  
 
===Justification for Minimalism===
 
===Justification for Minimalism===
Line 153: Line 180:
 
== Screensavers ==
 
== Screensavers ==
 
[https://tools.suckless.org/slock slock] or none at all
 
[https://tools.suckless.org/slock 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 most part everything is TUI
 
 
NOTE: Examples here are based on the least bloated option available if no other alternatives exist.
 
 
* Distro: [[Gentoo]], [[OpenBSD]], [https://voidlinux.org Void Linux], [http://crux.nu CRUX] GNU/Linux, [[9front]], or [http://alpinelinux.org Alpine Linux]);
 
* Userland: busybox statically linked, [https://git.2f30.org/hbase/log.html hbase], [http://core.suckless.org/ suckless core] (ubase, sbase, 9base) statically linked;
 
* Window Manager: [https://dwm.suckless.org DWM], rio, or TTY;
 
* Login/Display manager: sx [https://clbin.com/MJdl9 edited version to use with sbase tty(1)];
 
* File Manager: Sometimes [http://git.2f30.org/noice/ noice], [https://github.com/jarun/nnn nnn], or [https://github.com/gokcehan/lf LF], standard Unix utils like ls, cp, mv, etc.;
 
* Terminal Emulator: [https://st.suckless.org/ st];
 
* Web Browser(note: web is bloat): [https://surf.suckless.org surf], [https://lynx.invisible-island.net/ lynx], [http://netsurf-browser.org netsurf], w3m, cURL;
 
* gopher: [https://lynx.invisible-island.net/ lynx], [git://bitreich.org/sacc/ sacc], or hURL;
 
* Shell: [https://www.mirbsd.org/mksh.htm mksh] or [http://gondor.apana.org.au/~herbert/dash/ dash];
 
* OS information: they all rely on bash as a dependancy so just write you own or use ufetch if you run void;
 
* Screen lock/saver: [https://tools.suckless.org/slock slock];
 
* Music player: [http://www.musicpd.org/download.html mpd] + [https://www.musicpd.org/clients/mpc/ mpc], or [https://cmus.github.io/ cmus];
 
* Video player: [http://mpv.io/ mpv] or ffplay (part of ffmpeg);
 
* IRC client: [http://www.weechat.org/download/ weechat], [http://www.irssi.org/download irssi], [https://github.com/c00kiemon5ter/iii iii], [http://tools.suckless.org/ii/ ii],erc;
 
* Screen capture (screenshot): [http://scrot.sourcearchive.com/ scrot] or [http://www.imagemagick.org/script/install-source.php#unix import] (part of imagemagick);
 
* Image viewer/desktop wallpaper display: [https://github.com/younix/lel lel], [http://feh.finalrewind.org/ feh], or [https://github.com/muennich/sxiv sxiv] and [https://github.com/himdel/hsetroot hsetroot];
 
* PDF Viewer: [https://pwmt.org/projects/zathura/ zathura] using the mupdf backend, or better yet to view PostScript or DjVu files, [https://mupdf.com/ mupdf];
 
* Video conversion: [http://www.ffmpeg.org/ FFmpeg] (including WebM or GIF creation);
 
* Text editor: [http://acme.cat-v.org/ acme] (boarderline bloat), [http://www.vim.org/ Vim] (boarderline bloat), [https://github.com/neovim/neovim neovim] (better), [https://github.com/martanne/vis Vis] (best), or [http://sam.cat-v.org/ sam], [http://www.nano-editor.org/ Nano] (if you don't need/want a modal editor), Emacs
 
* Document creation: {g,t}roff, markdown;
 
* Other: [https://github.com/multiplexd/doas doas] (opendoas package on void) in place of sudo, 9front or plan9 and [http://man.cat-v.org/plan_9/4/factotum factotum] in place of Linux and PAM.
 
  
 
==External Resources==
 
==External Resources==

Revision as of 18:05, 7 July 2020

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:

  1. Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features".
  2. 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.
  3. 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.
  4. 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.

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 most part everything is TUI

NOTE: Examples here are based on the least bloated option available if no other alternatives exist.

  • Distro: Gentoo, OpenBSD, Void Linux, CRUX GNU/Linux, 9front, or Alpine Linux);
  • Userland: busybox statically linked, hbase, suckless core (ubase, sbase, 9base) statically linked;
  • Window Manager: DWM, rio, or TTY;
  • Login/Display manager: sx edited version to use with sbase tty(1);
  • 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 so just write you own or use ufetch if you run void;
  • Screen lock/saver: slock;
  • Music player: mpd + mpc, or cmus;
  • Video player: mpv or ffplay (part of ffmpeg);
  • IRC client: weechat, irssi, iii, ii,erc;
  • 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), Emacs
  • Document creation: {g,t}roff, markdown;
  • Other: doas (opendoas package on void) in place of sudo, 9front or plan9 and factotum in place of Linux and PAM.

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.

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.

File Systems

A quick note on file systems. It is hard to find any way to judge how minimal a filesystem is, but here are some pointers using some common and/or popular examples.

  • EXT4: has encryption built in which is bloat since dm-crypt does a better job. Alternatives: F2FS, xfs (if you need extents)
  • ZFS: breaks file system layer seperation. Combines a LVM, database and filesystem into one program. Alternatives: HAMMER2, soft/hard raid with a seperate LVM and a
  • NTFS, EXFAT, HFS+, etc.: bloatware botnets. If you need compatability an alternative is UDF which has an open implementation is highly portable and an industry standard, any system capable of reading a DVD can read and write to a drive formatted to UDF.

Some other considerations:

If you're going to have separate partitions for different directories under root you might as well optimize while you're at it:

  • /usr is where most of your binaries and libraries are stored, so low latency is more important than throughput, suggest NILFS, REISERFS, or REISER4. 20GB
  • /etc rarely takes up much disk space. Most files stored here are small (in the order of no larger than a few hundred kilobytes). Usually CA's for ssl auth are located somewhere in /etc as well. Suggest, REISERFS, REISER4, NILFS. 1-2GB
  • /var contains small files, is where the database for your package manager usually is and spools are usually located. A filesystem with high throughput on smaller files would be preferred. Suggest REISERFS, REISER4. 15GB
  • /boot doesn't need anything fancy and journaling on disk can just get in the way, suggest Fat32. 512MB
  • / most nix systems have a hard time booting if the root directory is using a less popular filesystem, suggest EXT3 or xfs. 30GB is a safe bet
  • /home if you have an SSD you'll want a general use filesystem that is optimized for flash storage in which case F2FS is your best bet. If not, xfs or EXT3. Usually this takes up the rest of the file system.

For the most bullet proof filesystem for something like a NAS you will probably want an atomic copy-on-write filesystem with checksumming, your best bet is HAMMER2.

You could of course skip all of this heart ache and just use one / partition formatted to something like EXT3, F2FS, or xfs and call it a day.

Window Managers

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
    • ratpoison - Minimal WM without the need of a mouse.
    • bspwm
    • xmonad - A minimal window manager written and configured in Haskell.
    • WMFS2
  • 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 sx from a tty instead.

Screensavers

slock or none at all

External Resources