Dotfiles

Setting up a dotfiles repo

It started with a youtube video

And as usual it spiraled out of control (took me a lot of time to update the blog)

So I made the repo as the video showed, then I realized I like having as close to a single command as possible

So I started up on an install script, then I remembered that dotbot was a thing

Why reinvent the wheel?

So I didn’t… Mostly

I wasn’t particularly satisfied with the shell module, what I wanted to do with it was a bit more complex than was elegant with dotbot.

That’s where a small bit of shell script comes in, but then no nice colored output on failure

Wen’t and learned how to color my output (just gonna leave this here)

info() {
  printf "\033[0;94m   [INFO] ${@}\033[0m\n"
}
warn() {
  printf "\033[0;33m   [WARN] ${@}\033[0m\n"
}
error() {
  printf "\033[0;31m  [ERROR] ${@}\033[0m\n"
}
success() {
  printf "\033[0;32m[SUCCESS] ${@}\033[0m\n"
}
debug() {
  if [ ! -z $DEBUG ] ; then printf "\033[0;37m  [DEBUG] ${@}\033[0m\n"; fi
}

Hiding output from other scripts in a way that I could turn off was a bit more interesting, but not like no one needed to do it before

output=/dev/null
if [ "$DEBUG" == 'verbose' ]; then
  output=/dev/stdout
fi

in the end you just source your other scripts and voila

for f in ./scripts/*.sh; do
  . "$f"
done

Custom script runner to install your stuff

See the repo for starship, fzf, and thefuck install scripts

Only about 20 tabs used for this, give or take