Dotfiles

This post is a summary of a talk I was asked to give in front of my fellow PhD students. It basically was a tutorial on shell scripting and dotfile integration. I gave a live demo in which I demonstrated how I install my dotfile repository on a new machine. Dotfiles set defaults for many different programs, and make personalization of these programs easy to back up.

Inspirations

Shells

Before talking about dotfiles, system configurations and customizations, we need to have a quick look at the basics, i.e. how we interact with the OS. Here some important keywords:

Dotfiles

My dotfiles

There are many resources offering dotfile configurations, setup and maintainance frameworks:

You can find my ever-growing dotfile collection here: github.com/phdenzel/dotfiles.

.USERINFO
.bashrc
.bash_profile
.aliases
.prompt
.path
.exports
.functions
.dircolors_macos
.dircolors_linux

.gitconfig
.gitignore
.pulls
.macOS

.inputrc
.screenrc
.wgetrc
.curlrc
.gdbinit
.hgignore
.editorconfig
.hushlogin

bootstrap.sh
|-- bin
|-- etc
|-- utils
|-- .emacs.d
    |-- server
|-- .config/neofetch
|-- installers
|-- custom

And this is how it looks…

img

Setting up a new machine

I work with lots of machines (currently about 6-7), some of them virtual. The more machines you have to set up, the more you wish you had writen something to automate this process…

  1. Install OS (and set up an internet connection)
  2. Install git (usually already installed, but old
    git clone https://github.com/git/git)
  3. Clone dotfile repository from GitHub
    git clone https://github.com/phdenzel/dotfiles
  4. Run install scripts depending on OS, e.g. brew.sh or apt.sh
  5. Bootstrap dotfiles source bootstrap.sh
  6. Install additional tools (via install scripts), e.g. emacs_installer.sh or python
  7. If the machine is permanent, install Dropbox and symlink all directories to $HOME