The battle over your dotfiles

Paul Becker
4 min readMay 10, 2023

--

Once upon a time in a parallel universe, the ultimate battle raged on — the battle of the dotfiles. It was an age-old conflict between chaotic folder structures and our never-ending quest for a tidy home directory. But lo and behold, the hero we all needed arrived, and its name was Dotbot!

Dotbot, a force to be reckoned with, tamed the wildest dotfiles and brought order to their management. No longer did we have to endure the complex symphony of symbolic links that GNU Stow had left us. Instead, we embraced the simple, sweet melodies of Dotbot’s git submodule, a harmony that bestowed upon us unimagined levels of convenience.

But wait, there’s more! Dotbot didn’t stop at being a mere manager of dotfiles; it turned into an all-powerful entity with the ability to harness the power of plugins. Plugins that could manage your Firefox profile, install packages, and even more.

One fateful day, as I strolled through the virtual realm of dotfile management, I encountered a challenge: I needed to write a Dotbot plugin for the Librewolf browser and Zypper for openSUSE packages. Armed with determination and a touch of self-doubt, I embarked on my mission.

After several sleepless nights, countless energy drinks, and a brief encounter with a llama named Steve, I emerged victorious! The plugin was complete. I now wielded the power to manage my Librewolf browser and Zypper packages, all thanks to Dotbot.

Say hello to Steve

Now, you may ask, what’s the big deal with Dotbot and plugins? Well, let me tell you, they’re like the ketchup to your fries, the sprinkles on your donut, the cheese on your pizza — they make an already great thing even better! And who doesn’t want to enjoy a bit of tasty goodness while managing their dotfiles?

But it’s not all fun and games. Dotbot and its plugins also offer a serious advantage for those looking to streamline their digital lives. With easy-to-use configuration files and the ability to automate tasks like setting up new machines, Dotbot turns dotfile management into a walk in the park — a park filled with rainbows, unicorns, and laughter.

Now, let’s dive into some code examples to showcase the magic of Dotbot. Imagine you’ve got a .dotfiles directory with a install.conf.yaml configuration file that looks like this:

- defaults:
link:
relink: true

- clean: ['~']

- link:
~/.vimrc: vimrc
~/.bashrc: bashrc
- shell:
- [git submodule update --init --recursive, Installing submodules]

Next, add Dotbot as a submodule to your .dotfiles repository:

git init
git submodule add https://github.com/anishathalye/dotbot

Now, create an install script called install in your .dotfiles directory with the following content:

#!/bin/bash

set -e

DOTBOT_DIR="dotbot"

CONFIG_FILE="install.conf.yaml"

DOTBOT_BIN="bin/dotbot"

BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "${BASEDIR}"
git submodule update --init --recursive "${DOTBOT_DIR}"

"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG_FILE}"

Finally, execute the Dotbot install script:

chmod +x install
./install

Voilà! Dotbot will now clean your home directory and create symbolic links for your vimrc and bashrc files according to the configuration you've provided. After that it will run the shell command git submodule update — init — recursive.

This simple configuration will clean your home directory, create symbolic links for your config files, and initialize any git submodules. Easy peasy, lemon squeezy!

But what about that special Dotbot plugin for Librewolf and Zypper I mentioned earlier? Well, my friends, today is your lucky day because I am sharing the fruits of my labor with you!

Check out my GitLab repository for the Librewolf and Zypper plugin: Gitlab Repo.

Before we bring this tale of dotfile hilarity and order to a close, it’s important to note that Dotbot isn’t the only solution out there. The dotfile universe is vast and diverse, with other options such as Home Manager, self-made scripts for dotfile management, and even the age-old practice of manually symlinking your files. Variety is the spice of life, after all!

In the end, the choice is yours, brave dotfile warriors. There’s a world of options waiting to be explored, and your perfect dotfile management solution is out there, just waiting to be discovered. But as for me, I’ll be sticking with Dotbot, taming my dotfiles one giggle at a time.

Thank you for joining me on this rollercoaster ride of digital organization and laughter. May you find the dotfile solution that brings order to your life. And remember, when the going gets tough, think of Dotbot and your way to victory.

Happy dotfile managing and until we meet again.

--

--

Paul Becker
Paul Becker

Written by Paul Becker

Why the f*ck are you reading that? Leave your Smartphone and Notebook... and go outside. There is nature you know? And a whole world!! So hush - way you go!

Responses (1)