We are still actively working on the spam issue.

Difference between revisions of "Software minimalism"

From InstallGentoo Wiki
Jump to: navigation, search
m
(expanded on the rational for the unix philosophy and minimalism, adjusted the reccomandations)
Line 24: Line 24:
 
*decrease vulnerabilities and remove attack vectors in our software
 
*decrease vulnerabilities and remove attack vectors in our software
 
*Become overall more efficient
 
*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 [https://harmful.cat-v.org/cat-v/ Program Design in the UNIX Environment]
 
For a more indepth explaination read [https://harmful.cat-v.org/cat-v/ Program Design in the UNIX Environment]
Line 127: Line 138:
  
 
* Distro: [[Gentoo]], [[OpenBSD]], [https://voidlinux.org Void Linux], [http://crux.nu CRUX] GNU/Linux, [[9front]], or [http://alpinelinux.org Alpine Linux]);
 
* Distro: [[Gentoo]], [[OpenBSD]], [https://voidlinux.org Void Linux], [http://crux.nu CRUX] GNU/Linux, [[9front]], or [http://alpinelinux.org Alpine Linux]);
* Window Manager: [https://dwm.suckless.org DWM];
+
* Userland: busybox statically linked, [http://core.suckless.org/ suckless core] (ubase, sbase, 9base) statically linked;
 +
* Window Manager: [https://dwm.suckless.org DWM], rio, or TTY;
 
* Login/Display manager: startx;
 
* Login/Display manager: startx;
* File Manager: Sometimes [http://git.2f30.org/noice/ noice], [https://github.com/jarun/nnn nnn], or [https://github.com/gokcehan/lf LF], but usually none;
+
* 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];
 
* 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;
 
* 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 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];
 
* Shell: [https://www.mirbsd.org/mksh.htm mksh] or [http://gondor.apana.org.au/~herbert/dash/ dash];
* OS information: [https://github.com/dylanaraps/neofetch Neofetch], or none at all;
+
* OS information: they all rely on bash as a dependancy;
 
* Screen lock/saver: [https://tools.suckless.org/slock slock];
 
* 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];
 
* Music player: [http://www.musicpd.org/download.html mpd] + [https://www.musicpd.org/clients/mpc/ mpc], or [https://cmus.github.io/ cmus];
Line 140: Line 152:
 
* IRC client: [http://www.weechat.org/download/ weechat] or [http://www.irssi.org/download irssi];
 
* IRC client: [http://www.weechat.org/download/ weechat] or [http://www.irssi.org/download irssi];
 
* Screen capture (screenshot): [http://scrot.sourcearchive.com/ scrot] or [http://www.imagemagick.org/script/install-source.php#unix import] (part of imagemagick);
 
* 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: [http://feh.finalrewind.org/ feh], or [https://github.com/muennich/sxiv sxiv] and [https://github.com/himdel/hsetroot hsetroot];
+
* 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;
+
* 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);
 
* Video conversion: [http://www.ffmpeg.org/ FFmpeg] (including WebM or GIF creation);
* Text editor: [http://www.vim.org/ Vim] (boarderline bloat), [https://github.com/neovim/neovim neovim] (better), [https://github.com/martanne/vis Vis] (best), or [http://www.nano-editor.org/ Nano] (if you don't need/want a modal editor);
+
* 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);
* Document creation: troff, markdown;
+
* Document creation: {g,t}roff, markdown;
* Other: [https://github.com/multiplexd/doas doas] (opendoas package on void) in place of sudo.  
+
* Other: [https://github.com/multiplexd/doas doas] (opendoas package on void) in place of sudo, [http://man.cat-v.org/plan_9/4/factotum factotum] in place of PAM.  
  
 
==External Resources==
 
==External Resources==
Line 154: Line 166:
  
 
[http://cat-v.org cat-v considered harmful]
 
[http://cat-v.org cat-v considered harmful]
 +
 +
[http://harmful.cat-v.org/software/operating-systems/linux/alsa ALSA and the Linux Audio Mess]
  
 
[https://www.2f30.org/home.html 2f30 - division by zero]
 
[https://www.2f30.org/home.html 2f30 - division by zero]

Revision as of 18:04, 23 April 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:

  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.

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.

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
    • 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 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

suckless

cat-v considered harmful

ALSA and the Linux Audio Mess

2f30 - division by zero