dot/README.md
2025-03-22 17:39:24 -05:00

3.2 KiB

Dot

Description

There is no place like $HOME. All my dotfiles, and a guide for bootstrapping a new install.

Table of Contents

Features / TODOS

  • Easy to copy.
  • Defaults to revert to.
  • Templates for easy productivity.
  • Usage Guide

Usage

Just copy and paste, or follow the guide below.

If you're starting out as root, do not login as user until you've altered /etc/xdg/user-dirs.defaults.

For example, you can see the custom configuration, or the default. Marked folders are mapped to xdg features. The ones linked to repositories need to be downloaded as needed. They are as follows:

  • DESKTOP=gui
  • DOWNLOAD=dl
  • TEMPLATES=eg
  • MARKDOWN=md
  • PUBLICSHARE=pub
  • DOCUMENTS=media/docs
  • MUSIC=media/music
  • PICTURES=media/pics
  • VIDEOS=media/vids
  • PDF=media/pdf
  • CAD=cad
  • REPO=repo
  • SCRIPTS=sh
  • VIRTUALMACHINES=vm

Once complete, assign the appropriate privileges, and login as the user.

If this is your first time setting this up. Run these commands:

git init --bare $HOME/.dot To create our dotfiles folder.
alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME' Set git to alias to config.
config config --local status.showUntrackedFiles no So every file is not tracked, just what we add.
echo "alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'" >> $HOME/.bashrc bashrc alias.

You can use the easy snippet here: curl https://gist.myrepos.dev/scratch.sh | bash

If you are already tracking your dotfiles and this a fresh install, you can run these commands:
alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME' Alias config
echo ".dot" >> .gitignore Avoid weird recursion problems where you clone.
git clone --bare https://github.com/Randy-Jordan/dot.git $HOME/.dot Clone repo
alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME' Current shell scope

You may already have some dotfiles, so we will back them up to avoid conficts.
mkdir -p .config-backup && \ config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \ xargs -I{} mv {} .config-backup/{}
Now we can run the checkout command to get our dotfiles from the repo.
config checkout
Make sure to set untracked files setting.
config config --local status.showUntrackedFiles no

These commands have also been made into an easy bash script: curl https://gist.myrepos.dev/config.sh | bash

config status To see status of your dotfiles.
config add .xyzfile To start adding dotfiles.

Credits / Resources

Tom Preston-Werner - README Driven Development
Dotfiles: Best way to store in a bare git repository

License

This project is licensed under GPLv3 - see the LICENSE file for details.