Dotfiles are a constant work in progress, this one is not yet ready to use! Be warned :)
Here’s a todolist:
- [ ] All folders must have a readme
- [ ] Give more info about my system
- [ ] Make tutorial for my future self :-) … and for others :D
As an Emacs user, I edit this document in Org Mode (notice the file extension). Github can parse Org documents but sometimes the result is kinda weird.
I like to add current user bin directories into the global $PATH. Edit /etc/profile to add
append_path "$HOME/.local/bin"
append_path "$HOME/bin"I’m using neomutt as my main email client. I do have a thunderbird arround also when I need something more adapted to the context (heavily html’d emails). Here’s how it works:
I’m using mbsync (from the isync package) to download all my emails from the remote to my local file system. mbsync also push to the remote all the operations i’m doing locally (delete email for example).
Having everything locally has many advantages:
- my email does not depend of my email provider
- searching and accessing email is super fast
All my emails are downloaded in ~/.mail/{email_address}
notmuch is an email indexer, it works by applying tags to emails in its database, and we can then use it to search quickly emails! We use it with afew, which is used to automatically apply tags.
notmuch database is located in ~/.mail/.notmuch/, and we installed a hook for afew at ~/.mail/.notmuch/hooks/post-new (file mode +x).
mbsync and notmuch are both called using a custom script in ~/.local/bin/sync-mail. When inactive, neomutt will issue the command to fetch now mail automatically.
I use neomutt as my emails client. It is configure to read my local emails and have no knowledge of the remote. Sending an email use my default editor.
Emails are sent using msmtp. neomutt is responsible for calling msmtp.
I know two ways of managing dotfiles:
- having a dotfiles folder where the original files live, and then use symlinks to make those file “appear” where they are suppose to. You could use a tool like GNU Stow to manage your symlinks.
- versionning directly the original files.
I decided to go with the latter, using a bare git repository.
A repository created with git init contain your working tree composed of the files currently checked out and a .git/ folder, containing all git related information of your repo. This kind of repository is ideal for a project on which you are working and where almost everything in there needs to be versionned.
A bare git repository, created with git init --bare are a bit different, first they do not create a .git folder, all the git related content is the actual content of this repository.
I am using a bare git repository to manage my dotfiles. In a usual git repository, that you’ll start using git init, a .git folder will be created in this folder to store all the information related to this project. The git repository is tightly related to the project. The source files do not live inside of the repository.
For me this is ideal as my git repository can live in its own folder (~/.dotfiles) and my files can live where they are suppose to be. And for the rest of the world, it does not makes any difference: if you close the repository, it’ll act like a normal (as in non bare) git repository. Also, git bare repository don’t care about other git repositories, which is a plus!
First we’ll create our bare repository, and create an alias for git to work with it:
git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
# v-- dotfiles=git as defined here --^
dotfiles config --local status.showUntrackedFiles no
# change .zshenv bellow by .bashrc or .zshrc if you prefer.
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOMEalias" >> $HOME/.zshenv
So we created a bare repository in $HOME/.dotfiles, created an alias dotfiles to as in lieu of git when working with our dotfiles. Then we tell our git repository that we don’t want a list of the untracked files when issuing the command dotfiles status, and finally we insert our alias in our shell autoloaded file.
Now just use dotfiles as you would git for your operations!
dotfiles status
dotfiles add your/config/file
dotfiles commit -m "your message"
dotfiles push
First, make sure you have this already installed:
- git
- zsh
- oh-my-zsh
- nvm
To install the dotfiles, you can either do a simple git clone and copy the files you want/need, or do a bare clone and checkout:
cd ~
git clone --bare https://github.com/julientant/dotfiles.git .dotfiles
alias dotfiles="/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"
mkdir -p .dotfiles-backup
dotfiles checkout
The checkout command might complain about existing files. You can either remove them, or be safe and copy them to have a backup. When done, use the checkout command again.
The theme we used is localted in home, we must make a symlink to the omz custom theme folder: ln -s ~/.gruvbox.zsh-theme .oh-my-zsh/custom/themes/gruvbox.zsh-theme