Skip to content

dskecse/dotfiles

Repository files navigation

build

Setup

git clone https://github.com/dskecse/dotfiles ~/.dotfiles
cd $_
[[ ! -f github_token ]] && cp github_token.example github_token
mkdir -p ~/.gnupg && ln -fs ~/.dotfiles/gpg-agent.conf ~/.gnupg/gpg-agent.conf
mkdir -p ~/.bundle && ln -fs ~/.dotfiles/bundle/config ~/.bundle/config
# Manully add "$HOMEBREW_PREFIX/bin" to PATH, so that "brew" command is available.
export PATH="/opt/homebrew/bin:$PATH"
brew tap thoughtbot/formulae
brew install rcm
env RCRC=$HOME/.dotfiles/rcrc rcup

What it does

It uses the rcup command from the Homebrew thoughtbot/formulae tap that installs and updates dotfiles.

All files without a dot prefix in the current directory are then symlinked to the dotted filename in the home directory, so ./zshrc is symlinked to ~/.zshrc.

All directories in the current one have their structure copied to the home directory, then a non-dotted symlink is created within, so ./bundle/config would cause the ~/.bundle directory to be created, then config would be symlinked within.

Exclusions can be specified in the user configuration file denoted by RCRC, which defaults to ~/.rcrc.

To revert the changes, use the rcdn command, which is the opposite of rcup.

To test the changes to the .rcrc file or simply dry-run the rcup command, use the lsrc command that shows all the dotfiles that would be created and where they would be symlinked to.

Benchmarking

To figure out how fast a new tab opens in a terminal, first make sure to gather the shell arguments in a terminal tab currently open:

> echo "$-"
569JNRXZghiklms

In this case e.g. i indicates whether the shell is "interactive", and l whether the shell is a "login" one (see the output of zsh --help for more info).

NOTE: Another way to check whether the shell is interactive/non-interactive or login/non-login:

[[ -o interactive ]] && echo "interactive" || echo "non-interactive"
[[ -o login ]] && echo "login" || echo "non-Login"

Then run the following command with the options above or at least il (if they are present):

repeat 3 { /usr/bin/time zsh -il -c exit }

The last time it was run, the stats were:

0.56 real         0.27 user         0.26 sys
0.55 real         0.27 user         0.26 sys
0.54 real         0.26 user         0.26 sys

To find out what happens during that time, run:

zsh -il -x

This will output the zsh init process xtrace output to stderr. In order to redirect the output to a running log file instead, run:

exec 2>> trace.log
set -x
zsh -il -x

https://comp.unix.shell.narkive.com/B3NOS6f2/zsh-how-to-send-startup-scripts-xtrace-to-file

Benchmarks are now run on Github Actions using hyperfine. The following are initial results:

Benchmark 1: zsh -il -c exit

  Time (mean ± σ):      19.1 ms ±   3.5 ms    [User: 5.1 ms, System: 13.7 ms]
  Range (min … max):    18.2 ms …  46.0 ms    65 runs
  Warning: The first benchmarking run for this command was significantly slower than the rest (46.0 ms). This could be caused by (filesystem) caches that were not filled until after the first run. You should consider using the '--warmup' option to fill those caches before the actual benchmark. Alternatively, use the '--prepare' option to clear the caches before each timing run.

TODO

  • Add Apple Silicon support
  • Run benchmarks via Github Actions
  • Compare benchmarks between runs to avoid performance regressions

Inspiration

https://github.com/lest/dotfiles

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •