Skip to content
Projekte

Über uns

My dotfiles, install scripts, and tools for macOS, Linux, and WSL. Pilfer at your own peril.

Entwicklerwerkzeuge

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

Unix/Linux dotfiles, scripts, and stuff

Pilfer at your own peril. If you are thinking of following, just know I commit to main about once every three days, if I had several commits I will put them in a draft PR to avoid blowing followers away with commit notifications.

Don't forget to install fonts as well if you want to use everything in here.

What's here

Directory What it is
config/ Configuration, one directory per tool (bash, vim, tmux, git, ...), most with a setup
install/ install-* scripts that install tools (mac, ubuntu, redhat, windows)
bin/ Small standalone commands, indexed in bin/README.md; the bashrc setup adds them to your PATH automatically

Nothing in the repo is a hidden file. Files like config/bash/bashrc are plain names so they show up in ls, and each tool's setup script creates the dotted symlink in $HOME (~/.bashrc, ~/.tmux.conf, ...).

To link everything into place run ./setup from the repo root. A tool whose setup fails (usually because the tool is not installed) is reported at the end and never stops the others. To set up just one tool run ./setup inside its directory, for example config/vim/setup.

These are not part of ./setup: cowsay, fortunes and obs are just files to use or copy.

Where things live

  • bashrc finds this repo through $DOTFILES and puts $DOTFILES/bin on your PATH. Nothing depends on a ~/Scripts directory or a $SCRIPTS variable.
  • Under WSL2, bashrc drops the Windows folders from PATH, because searching them made shells and prompts slow. Windows commands are rarely needed here, so each one is added explicitly by config/wsl/setup. See why.
  • Machine-specific values (GITUSER, DOTFILES, TZ) are written once by config/bash/setup to ~/.config/dot/env, which is never committed. Git identity and signing keys are set by config/git/setup into your untracked ~/.gitconfig.
  • Author-specific bash settings live in config/bash/personal. Fork the repo and edit that file to make it yours; bashrc stays generic.
  • Repositories are expected under lowercase ~/repos (~/repos/github.com/<user>/dot), and CDPATH is never used anywhere.

Operating system preference

Everything in this repo will work on any Unix or Linux system once the dependencies are satisfied. As for host workstation operating systems I personally prefer the following in order:

  1. macOS (Unix)
  2. WSL2 with wslu (Linux)
  3. Linux Mint Cinnamon

Note that much of this repo content will also work with Git-Bash, Cygwin, and MinGW but not all.

When I use Windows, it is with one of two setups:

Under WSL2, config/wsl/setup copies wslconfig to %USERPROFILE%\.wslconfig, which turns on mirrored networking (Windows 11 22H2 or later) so localhost works in both directions. An existing file that differs is backed up and replaced. Apply changes with wsl --shutdown, which stops everything running in WSL; read why and what to expect first.

Core dependencies

Before running any install-* script make sure the system has:

  • /bin/sh (POSIX 2018, no ksh-isms)
  • /usr/bin/perl (v5.26 which modern git depends on)
  • git
  • curl
  • uname

Note that perl—required for any git install—is used more efficiently and powerfully than any of the usual handicapped alternatives: sed, awk, grep, head, tail, cut, tr, etc.

In true Unix fashion, many of the scripts in bin/ depend on one another and on the tools the install-* scripts provide.

Installing tools

On macOS, install/mac/install-most-stuff-with-brew installs most of what the config expects with Homebrew. On Ubuntu, install/ubuntu/install-most-stuff-with-apt does the same, and the other install-* scripts there install a single tool from its latest official release, usually by way of gh release download or go install.

Scripts over functions and aliases

Even a one-line script works anywhere: as a Vim filter, pipeline text transformation, and interactive command. Functions cannot be called universally from other executables. In fact, the only time a function should ever be used is when the state of the current shell needs to change, such as changing the current working directory (see the clone and cdd functions in config/bash/bashrc).

Aliases are nice to same typing on the command line, but that is the only place they should ever be used. Very often an alias is better as a one-line script.

The cdd function

cdd NAME changes into the first directory called NAME (or whose name contains it, ignoring case) found below the roots in $CDD, a PATH-like list set in config/bash/personal. It is a function because only a function can change your directory, and unlike CDPATH it never changes plain cd, so scripts are unaffected. Hits are cached; cdd -f NAME searches again. See the comment above cdd in bashrc for the details.

Checking changes

Run ./check before committing. It changes nothing and checks shell syntax, shellcheck errors, Markdown (with rumdl) and a few repo rules, such as every script in bin/ having a row in its index. It needs shellcheck and rumdl.

More info

Have questions about any of this? Come ask them on my Twitch live stream, or watch my videos, which you can search in my videos repo.

Ähnliche Projekte entdecken

Wird geladen…