Difference between revisions of "Dotfiles"

From ArchWiki
Jump to navigation Jump to search
(update Pkg/AUR templates)
(Tag: wiki-scripts)
m (User repositories: nit)
 
(92 intermediate revisions by 34 users not shown)
Line 1: Line 1:
{{Lowercase title}}
+
[[Category:Configuration files]]
[[Category:Dotfiles]]
+
[[Category:Configuration management]]
 
[[ja:ドットファイル]]
 
[[ja:ドットファイル]]
 +
[[pt:Dotfiles]]
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|XDG Base Directory support}}
 
{{Related|XDG Base Directory support}}
 +
{{Related|X resources}}
 
{{Related articles end}}
 
{{Related articles end}}
This article collects user repositories with custom configuration files, commonly known as ''dotfiles''.
+
User-specific application configuration is traditionally stored in so called [[Wikipedia:dotfile|dotfiles]] (files whose filename starts with a dot). It is common practice to track dotfiles with a [[version control system]] such as [[Git]] to keep track of changes and synchronize dotfiles across various hosts. There are various approaches to managing your dotfiles (e.g. directly tracking dotfiles in the home directory v.s. storing them in a subdirectory and symlinking/copying/generating files with a [[shell]] script or [[#Tools|a dedicated tool]]). Apart from explaining how to manage your dotfiles this article also contains [[#User repositories|a list of dotfile repositories]] from Arch Linux users.
  
== Version control ==
+
== Tracking dotfiles directly with Git ==
  
Managing dotfiles with version control software such as [[Git]] helps to keep track of changes, share with others, and synchronize dotfiles across various hosts.
+
The benefit of tracking dotfiles directly with Git is that it only requires [[Git]] and does not involve symlinks. The disadvantage is that [[#Host-specific configuration|host-specific configuration]] generally requires merging changes into multiple [[Git#Branching|branches]].
  
=== Using gitignore ===
+
The simplest way to achieve this approach is to initialize a [[Git]] repository directly in your home directory and ignoring all files by default with a {{man|5|gitignore}} pattern of {{ic|*}}. This method however comes with two drawbacks: it can become confusing when you have other Git repositories in your home directory (e.g. if you forget to initialize a repository you suddenly operate on your dotfile repository) and you can no longer easily see which files in the current directory are untracked (because they are ignored).
  
Keeping a [https://git-scm.com/blog/2010/04/11/environment.html git directory] inside the home folder allows to directly keep track of changes. It is recommended to selectively add file contents to the index with {{man|1|git-add}}.
+
An alternative method without these drawbacks is the "bare repository and alias method" popularized by [https://news.ycombinator.com/item?id=11070797 this Hacker News comment], which just takes three commands to set up:
  
To prevent untracked files (appearing in commits and removed by {{man|1|git-clean}}), first exclude all files with {{man|5|gitignore}}:
+
$ git init --bare ~/.dotfiles
 +
$ alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
 +
$ config config status.showUntrackedFiles no
  
{{hc|~/.git/info/exclude|
+
You can then manage your dotfiles with the created [[alias]].
*}}
 
  
Then use {{ic|git add -f}}, for example:
+
{{Tip|To avoid accidentally commiting confidential information, see [[Git#Filtering confidential information]].}}
  
$ git add -f ~/.config/*
+
== Host-specific configuration ==
  
And commit the changes with {{man|1|git-commit}}:
+
A common problem with synchronizing dotfiles across various machines is host-specific configuration.
  
$ git commit -a
+
With [[Git]] this can be solved by maintaining a master branch for all shared configuration, while each individual machine has a machine-specific branch checked out. Host-specific configuration can be committed to the machine-specific branch; when shared configuration is modified in the master branch, the per-machine branches need to be rebased on top of the updated master.
  
=== Other tools ===
+
In configuration scripts like [[Command-line shell#Configuration files|shell configuration files]] conditional logic can be used. For example, [[Bash]] scripts (i.e. {{ic|.bashrc}}) can apply different configuration depending on the machine name (or type, custom variable, etc.):
  
* {{App|dotbot|A minimalist dotfiles manager that can be installed as a git submodule of your dotfiles repository.|https://github.com/anishathalye/dotbot}}
+
if <nowiki>[[ "$(hostname)" == "archlaptop" ]];</nowiki> then
* {{App|dotfiles|A tool to make managing your dotfile symlinks in $HOME easy, allowing you to keep all of them in a single directory.|https://github.com/jbernard/dotfiles|{{AUR|dotfiles}}}}
+
    # laptop specific commands here
* {{App|dotgit|A comprehensive solution to managing your dotfiles.|http://github.com/Cube777/dotgit|{{AUR|dotgit}}}}
+
else
* {{App|dots|A portable tool for managing a single set of dotfiles in an organized fashion.|https://github.com/EvanPurkhiser/dots|{{AUR|dots-manager}}}}
+
    # desktop or server machine commands
* {{App|[[etckeeper]]|Intended to version-control system-wide configuration in /etc. Works by keeping track of permissions and modes which version-control software often ignores. Can use various SCM systems as a backend. Hooks can auto-commit changes to the repository before a system-upgrade; for pacman, these hooks currently have to be triggered manually.|http://joeyh.name/code/etckeeper/|{{Pkg|etckeeper}}}}
+
fi
* {{App|GNU Stow|Can be used to symlink dotfiles from a repository into the $HOME tree. See [http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html] for more information.|http://www.gnu.org/software/stow/|{{Pkg|stow}}}}
 
* {{App|homeshick|git dotfiles synchronizer written in bash.|https://github.com/andsens/homeshick|{{AUR|homeshick-git}}}}
 
* {{App|homesick|Your home directory is your castle. Don't leave your dotfiles behind.|https://github.com/technicalpickles/homesick|{{AUR|homesick}}}}
 
* {{App|mackup|a small Python utitlity to keep your application settings in sync.|https://github.com/lra/mackup|{{AUR|mackup}}}}
 
* {{App|Pearl|Package manager for dotfiles, plugins, programs and any form of code accessible via git. Allow to easily share and sync packages across systems and have them ready to work out of the box.|https://github.com/pearl-core/pearl|{{AUR|pearl-git}}}}
 
* {{App|rcm|Can be used to symlink dotfiles from a repository into the $HOME tree.|https://github.com/thoughtbot/rcm|{{AUR|rcm}}}}
 
* {{App|vcsh|Allows separating differents modules (e.g., Emacs config vs. zsh config) into individual repositories which can be maintained separately, as opposed to keeping all dotfiles in a single repository. Works with git only.|https://github.com/RichiH/vcsh|{{AUR|vcsh}}}}
 
* {{App|yadm|Manages files across systems using a single Git repository. Provides a way to use alternate files on a specific OS or host. Supplies a method of encrypting confidential data so it can safely be stored in your repository.|https://github.com/TheLocehiliosan/yadm|{{AUR|yadm}}{{Broken package link|package not found}}}}
 
  
=== Maintaining dotfiles across multiple machines ===
+
Similar can also be achieved with [[.Xresources]].[https://jnrowe.github.io/articles/tips/Sharing_Xresources_between_systems.html]
  
{{Style|This and the section below need a rewrite}}
+
If you find rebasing Git branches too cumbersome, you may want to use a [[#Tools|tool]] that supports ''file grouping'', or if even greater flexibility is desired, a tool that does ''processing''.
  
One way of maintaining dotfiles across various machines across various hosts while still allowing for per-host customizations, is by maintaining a master-branch for all shared configuration, while each individual machine has a machine-specific branch checked out. Host-specific configuration can be committed to the machine-specific branch; as shared configuration is added to the master-branch, the per-machine branches are then rebased on top of the updated master.
+
== Tools ==
  
Another approach is to put machine-specific configuration into specially commented blocks and to use [https://pypi.python.org/pypi/mir.qualia/ qualia] to automatically uncomment them on each machine.  This approach requires less manual work and doesn't cause merge conflicts.
+
;File grouping
 +
:How configuration files can be grouped to configuration groups (also called profiles or packages).
 +
;Processing
 +
:Some tools process configuration files to allow them to be customized depending on the host.
  
=== Confidential information ===
+
{| class="wikitable sortable" style="text-align: center;"
 +
! Name !! Package !! Written in !! File grouping !! Processing
 +
|-
 +
! [https://deadc0de.re/dotdrop/ dotdrop]
 +
| {{AUR|dotdrop}} || Python || configuration file || Jinja2
 +
|-
 +
! [https://github.com/jbernard/dotfiles dotfiles]
 +
| {{AUR|dotfiles}} || Python || {{Grey|[https://github.com/jbernard/dotfiles/pull/24 No]}} || {{Grey|No}}
 +
|-
 +
! [https://github.com/EvanPurkhiser/dots Dots]
 +
| {{AUR|dots-manager}} || Python || directory-based || custom append points
 +
|-
 +
! [https://www.gnu.org/software/stow/ GNU Stow]
 +
| {{Pkg|stow}} || Perl || directory-based[http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html] || {{Grey|No}}
 +
|-
 +
! [https://github.com/lra/mackup Mackup]
 +
| {{AUR|mackup}} || Python || automatic per application || {{Grey|No}}
 +
|-
 +
! [https://github.com/darkfeline/mir.qualia mir.qualia]
 +
| {{AUR|mir.qualia}} || Python || {{Grey|No}} || custom blocks
 +
|-
 +
! [https://github.com/thoughtbot/rcm rcm]
 +
| {{AUR|rcm}} || Perl || directory-based (by host or tag) || {{Grey|No}}
 +
|}
  
Occasionally, software may keep plain-text passwords in configuration files, as opposed to hooking into a keyring. In these cases, git clean-filters may be handy to avoid accidentally commiting confidential information. E. g., the following .gitattributes file assigns a filter to the file “some-dotfile”:
+
=== Tools wrapping Git ===
  
<pre>
+
If you are uncomfortable with [[Git]], you may want to use one of these tools, which abstract the version control system away (more or less).
# .gitattributes
 
some-dotfile filter=remove-pass
 
</pre>
 
  
Whenever the file “some-dotfile” is checked into git, git will invoke the filter “remove-pass” on the file before checking it in. The filter must be defined in .git/config, e. g.:
+
{| class="wikitable sortable" style="text-align:center;"
 +
! Name !! Package !! Written in !! File grouping !! Processing
 +
|-
 +
! [https://github.com/kobus-v-schoor/dotgit dotgit]
 +
| {{AUR|dotgit}} || Bash || filename-based || {{Grey|No}}
 +
|-
 +
! [https://github.com/andsens/homeshick homeshick]
 +
| {{AUR|homeshick-git}} || Bash || repository-wise || {{Grey|No}}
 +
|-
 +
! [https://github.com/technicalpickles/homesick homesick]
 +
| {{AUR|homesick}} || Ruby || repository-wise || {{Grey|No}}
 +
|-
 +
! [https://github.com/pearl-core/pearl Pearl]
 +
| {{AUR|pearl-git}} || Bash || repository-wise || {{Grey|No}}
 +
|-
 +
! [https://github.com/RichiH/vcsh vcsh]
 +
| {{AUR|vcsh}} || Shell || repository-wise || {{Grey|No}}
 +
|-
 +
! [https://thelocehiliosan.github.io/yadm/ yadm]<sup>(1)</sup>
 +
| {{AUR|yadm-git}} || Shell || filename-based<br>(by class, OS, hostname & user) [https://thelocehiliosan.github.io/yadm/docs/alternates] || Jinja2<br>(optional)[https://thelocehiliosan.github.io/yadm/docs/alternates#jinja-templates]
 +
|}
  
<pre>
+
# Supports encryption of confidential files with [[GPG]].[https://thelocehiliosan.github.io/yadm/docs/encryption]
[filter "remove-pass"]
 
clean = "sed -e 's/^password=.*/#password=TODO/'"
 
</pre>
 
  
== Repositories ==
+
== User repositories ==
  
{| class="wikitable sortable"
+
{| class="wikitable sortable" style="text-align:center"
! scope="col" | Author
+
! Author || Shell (Shell framework) || WM / DE || Editor || Terminal || Multiplexer || Audio || Monitor || Mail || IRC
! scope="col" | Shell (shell framework)
 
! scope="col" | WM / DE
 
! scope="col" | Editor
 
! scope="col" | Terminal
 
! scope="col" | Multiplexer
 
! scope="col" | Audio
 
! scope="col" | Monitor
 
! scope="col" | Mail
 
! scope="col" | IRC
 
 
|-
 
|-
! [https://bitbucket.org/ambrevar/dotfiles Ambrevar]
+
! [https://github.com/alfunx/.dotfiles alfunx]
| zsh || awesome || emacs || rxvt-unicode || || cmus || htop/vicious || mutt ||
+
| zsh || awesome || vim || kitty || tmux || ncmpcpp/mpd || htop/lain || thunderbird ||
 +
|-
 +
! [https://gitlab.com/Ambrevar/dotfiles Ambrevar]
 +
| Eshell || EXWM || Emacs || Emacs (Eshell) || Emacs TRAMP + dtach || EMMS || conky/dzen || mu4e || Circe
 
|-
 
|-
 
! [https://github.com/awalGarg/dotfiles awal]
 
! [https://github.com/awalGarg/dotfiles awal]
| fish || i3 || vim || sakura || tmux || || i3status || || The Lounge
+
| fish || i3 || vim || st || tmux || || i3status || || The Lounge
 +
|-
 +
! [https://github.com/ayekat/dotfiles ayekat]
 +
| zsh || karuiwm || vim || rxvt-unicode || tmux || ncmpcpp/mpd || karuibar || mutt || irssi
 
|-
 
|-
 
! [https://github.com/bamos/dotfiles bamos]
 
! [https://github.com/bamos/dotfiles bamos]
Line 94: Line 126:
 
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || screen || || dzen || [https://github.com/pbrisbin/mutt-config mutt] || [https://github.com/pbrisbin/irssi-config irssi]
 
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || screen || || dzen || [https://github.com/pbrisbin/mutt-config mutt] || [https://github.com/pbrisbin/irssi-config irssi]
 
|-
 
|-
! [https://github.com/bstaletic bstaletic]
+
! [https://gitlab.com/BVollmerhaus/dotfiles BVollmerhaus]
| [https://github.com/bstaletic/dotfiles/blob/master/.zshrc zsh] || [https://github.com/bstaletic/dotfiles/blob/master/dwm/config.h dwm] || [https://github.com/bstaletic/dotfiles/blob/master/.vimrc vim]{{Dead link|2016|11|19}} || terminator || screen || [https://github.com/bstaletic/blob/master/.ncmpcpp/config ncmpcpp]{{Dead link|2016|11|19}} || [https://github.com/bstaletic/dotfiles/blob/master/.conkyrc conky] || ||
+
| [https://gitlab.com/BVollmerhaus/dotfiles/tree/master/config/fish-custom fish] || [https://gitlab.com/BVollmerhaus/dotfiles/blob/master/config/i3/config i3-gaps] || [https://gitlab.com/BVollmerhaus/dotfiles/blob/master/config/kak/kakrc kakoune] || rxvt-unicode || || || [https://gitlab.com/BVollmerhaus/dotfiles/blob/master/config/polybar/config polybar] || thunderbird ||
 
|-
 
|-
 
! [https://github.com/cinelli/dotfiles cinelli]
 
! [https://github.com/cinelli/dotfiles cinelli]
 
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat
 
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat
 
|-
 
|-
! [https://github.com/drkh5h/dotfiles drkhsh]
+
! [https://github.com/dikiaap/dotfiles dikiaap]
| zsh || dwm || vim || st || screen || cmus || conky || mutt || weechat
+
| zsh || i3-gaps || neovim || alacritty || tmux || || i3blocks || ||
 
|-
 
|-
 
! [https://github.com/Earnestly/dotfiles Earnestly]
 
! [https://github.com/Earnestly/dotfiles Earnestly]
Line 114: Line 146:
 
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]
 
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]
 
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||
 
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||
|-
 
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]{{Dead link|2016|11|19}}
 
| zsh || dwm || vim || termite-git || tmux || mpd || conky || mutt || weechat
 
 
|-
 
|-
 
! [https://github.com/hugdru/dotfiles hugdru]
 
! [https://github.com/hugdru/dotfiles hugdru]
| zsh || awesome || neovim || rxvt-unicode || tmux || || || thunderbird || weechat
+
| zsh || awesome || neovim || rxvt-unicode || tmux || || || thunderbird || weechat
 
|-
 
|-
 
! [https://github.com/insanum/dotfiles insanum]
 
! [https://github.com/insanum/dotfiles insanum]
 
| bash || herbstluftwm || vim || evilvte || tmux || || dzen || mutt-kz ||
 
| bash || herbstluftwm || vim || evilvte || tmux || || dzen || mutt-kz ||
|-
 
! [https://github.com/izmntuk/archiso/tree/testing/configs/alter/airootfs/ izmntuk]
 
| zsh || xfce4 || vim || rxvt-unicode/yaft || tmux || cmus || xfce4-panel ||  || irssi
 
 
|-
 
|-
 
! [https://bitbucket.org/jasonwryan/shiv/src jasonwryan]
 
! [https://bitbucket.org/jasonwryan/shiv/src jasonwryan]
| bash/zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irrsi
+
| bash/zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irssi
 
|-
 
|-
 
! [https://github.com/JDevlieghere/dotfiles/ jdevlieghere]
 
! [https://github.com/JDevlieghere/dotfiles/ jdevlieghere]
Line 135: Line 161:
 
! [https://github.com/jelly/Dotfiles jelly]
 
! [https://github.com/jelly/Dotfiles jelly]
 
| zsh || i3 || vim || termite || tmux || ncmpcpp || || mutt-kz-git || weechat
 
| zsh || i3 || vim || termite || tmux || ncmpcpp || || mutt-kz-git || weechat
 +
|-
 +
! [https://github.com/maximbaz/dotfiles maximbaz]
 +
| zsh || i3-gaps || neovim || kitty || || || py3status || thunderbird ||
 +
|-
 +
! [https://gitlab.com/mehalter/dotfiles mehalter]
 +
| zsh || i3-gaps || neovim || termite || tmux || gpymusic || i3blocks, gotop || neomutt || weechat
 
|-
 
|-
 
! [https://github.com/meskarune/.dotfiles meskarune]
 
! [https://github.com/meskarune/.dotfiles meskarune]
Line 141: Line 173:
 
! [https://github.com/neersighted/dotfiles neersighted]
 
! [https://github.com/neersighted/dotfiles neersighted]
 
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp || htop || mutt || irssi
 
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp || htop || mutt || irssi
 +
|-
 +
! [https://github.com/oibind/dotfiles oibind]
 +
| fish || awesome || neovim || termite || || || htop-vim || || weechat
 
|-
 
|-
 
! [https://github.com/ok100/configs OK100]
 
! [https://github.com/ok100/configs OK100]
 
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat
 
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat
 
|-
 
|-
! [https://github.com/pid1/dotfiles pid1]
+
! [https://github.com/pablox-cl/dotfiles pablox-cl]
| zsh || dwm || neovim || st || tmux || || custom || mutt || weechat
+
| zsh (zplug) || gnome3 || neovim || kitty || || || || ||
 +
|-
 +
! [https://github.com/reisub0/dot reisub0]
 +
| fish || qtile || neovim || kitty || || mpd || conky || ||
 +
|-
 +
! [https://github.com/sistematico/majestic sistematico]
 +
| zsh/fish/bash || [https://github.com/Airblader/i3 i3-gaps] || vim/nano || termite || tmux || ncmpcpp || polybar || mutt || weechat
 
|-
 
|-
! [https://github.com/polyzen/dotfiles polyzen]
+
! [https://git.sitilge.id.lv/sitilge/dotfiles sitilge]
| zsh || i3 || vim || termite || tmux || || i3status || || weechat
+
| zsh || awesome ||neovim || termite || || || || thunderbird ||
 
|-
 
|-
! [https://bitbucket.org/swalladge/dotfiles swalladge]{{Dead link|2016|11|19}}
+
! [https://github.com/swalladge/dotfiles swalladge]
 
| zsh/bash || i3 || neovim/vim || termite || tmux || cmus || i3pystatus || mutt ||
 
| zsh/bash || i3 || neovim/vim || termite || tmux || cmus || i3pystatus || mutt ||
 +
|-
 +
! [https://github.com/SyfiMalik/cfg SyfiMalik]
 +
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp/mpd || polybar || mutt || weechat
 
|-
 
|-
 
! [https://github.com/thiagowfx/dotfiles thiagowfx]
 
! [https://github.com/thiagowfx/dotfiles thiagowfx]
| bash/zsh || i3 || vim/emacs || rxvt-unicode || || ncmpcpp || i3blocks || ||
+
| bash || i3 || vim/emacs || tilix || || || i3blocks || ||
|-
 
! [http://hg.subtle.de/dotfiles/file unexist]
 
| zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi
 
 
|-
 
|-
 
! [https://github.com/vodik/dotfiles vodik]
 
! [https://github.com/vodik/dotfiles vodik]
Line 165: Line 206:
 
! [https://github.com/w0ng/dotfiles w0ng]
 
! [https://github.com/w0ng/dotfiles w0ng]
 
| zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irssi
 
| zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irssi
 +
|-
 +
! [https://github.com/whitelynx/dotfiles whitelynx]
 +
| fish || i3 || neovim || kitty || || || i3pystatus || ||
 
|-
 
|-
 
! [https://github.com/Wintervenom/Configuration Wintervenom]
 
! [https://github.com/Wintervenom/Configuration Wintervenom]
Line 171: Line 215:
 
! [https://github.com/wolfcore/dotfiles wolfcore]  
 
! [https://github.com/wolfcore/dotfiles wolfcore]  
 
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat
 
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat
|-
 
! [https://github.com/xfausto/dotfiles xfausto]{{Dead link|2016|11|19}}
 
| zsh || dwm || vim || st || || ncmpcpp || conky || ||
 
 
|-
 
|-
 
! [https://github.com/zendeavor zendeavor]
 
! [https://github.com/zendeavor zendeavor]
 
| [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]
 
| [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]
|-
 
! [https://github.com/0n-s/dotfiles dillebidum]
 
| zsh/mksh || dwm/i3 || vim/vis || st || tmux/dvtm || ncmpcpp/mpv || htop/i3blocks || mutt || ii/irssi
 
 
|-
 
|-
  
Line 190: Line 228:
 
* [http://dotshare.it dotshare.it]
 
* [http://dotshare.it dotshare.it]
 
* [https://dotfiles.github.io/ dotfiles.github.io]
 
* [https://dotfiles.github.io/ dotfiles.github.io]
 +
* [https://terminal.sexy/ terminal.sexy] - Terminal color scheme designer

Latest revision as of 06:20, 10 April 2019

User-specific application configuration is traditionally stored in so called dotfiles (files whose filename starts with a dot). It is common practice to track dotfiles with a version control system such as Git to keep track of changes and synchronize dotfiles across various hosts. There are various approaches to managing your dotfiles (e.g. directly tracking dotfiles in the home directory v.s. storing them in a subdirectory and symlinking/copying/generating files with a shell script or a dedicated tool). Apart from explaining how to manage your dotfiles this article also contains a list of dotfile repositories from Arch Linux users.

Tracking dotfiles directly with Git

The benefit of tracking dotfiles directly with Git is that it only requires Git and does not involve symlinks. The disadvantage is that host-specific configuration generally requires merging changes into multiple branches.

The simplest way to achieve this approach is to initialize a Git repository directly in your home directory and ignoring all files by default with a gitignore(5) pattern of *. This method however comes with two drawbacks: it can become confusing when you have other Git repositories in your home directory (e.g. if you forget to initialize a repository you suddenly operate on your dotfile repository) and you can no longer easily see which files in the current directory are untracked (because they are ignored).

An alternative method without these drawbacks is the "bare repository and alias method" popularized by this Hacker News comment, which just takes three commands to set up:

$ git init --bare ~/.dotfiles
$ alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
$ config config status.showUntrackedFiles no

You can then manage your dotfiles with the created alias.

Tip: To avoid accidentally commiting confidential information, see Git#Filtering confidential information.

Host-specific configuration

A common problem with synchronizing dotfiles across various machines is host-specific configuration.

With Git this can be solved by maintaining a master branch for all shared configuration, while each individual machine has a machine-specific branch checked out. Host-specific configuration can be committed to the machine-specific branch; when shared configuration is modified in the master branch, the per-machine branches need to be rebased on top of the updated master.

In configuration scripts like shell configuration files conditional logic can be used. For example, Bash scripts (i.e. .bashrc) can apply different configuration depending on the machine name (or type, custom variable, etc.):

if [[ "$(hostname)" == "archlaptop" ]]; then
    # laptop specific commands here
else
    # desktop or server machine commands
fi

Similar can also be achieved with .Xresources.[1]

If you find rebasing Git branches too cumbersome, you may want to use a tool that supports file grouping, or if even greater flexibility is desired, a tool that does processing.

Tools

File grouping
How configuration files can be grouped to configuration groups (also called profiles or packages).
Processing
Some tools process configuration files to allow them to be customized depending on the host.
Name Package Written in File grouping Processing
dotdrop dotdropAUR Python configuration file Jinja2
dotfiles dotfilesAUR Python No No
Dots dots-managerAUR Python directory-based custom append points
GNU Stow stow Perl directory-based[2] No
Mackup mackupAUR Python automatic per application No
mir.qualia mir.qualiaAUR Python No custom blocks
rcm rcmAUR Perl directory-based (by host or tag) No

Tools wrapping Git

If you are uncomfortable with Git, you may want to use one of these tools, which abstract the version control system away (more or less).

Name Package Written in File grouping Processing
dotgit dotgitAUR Bash filename-based No
homeshick homeshick-gitAUR Bash repository-wise No
homesick homesickAUR Ruby repository-wise No
Pearl pearl-gitAUR Bash repository-wise No
vcsh vcshAUR Shell repository-wise No
yadm(1) yadm-gitAUR Shell filename-based
(by class, OS, hostname & user) [3]
Jinja2
(optional)[4]
  1. Supports encryption of confidential files with GPG.[5]

User repositories

Author Shell (Shell framework) WM / DE Editor Terminal Multiplexer Audio Monitor Mail IRC
alfunx zsh awesome vim kitty tmux ncmpcpp/mpd htop/lain thunderbird
Ambrevar Eshell EXWM Emacs Emacs (Eshell) Emacs TRAMP + dtach EMMS conky/dzen mu4e Circe
awal fish i3 vim st tmux i3status The Lounge
ayekat zsh karuiwm vim rxvt-unicode tmux ncmpcpp/mpd karuibar mutt irssi
bamos zsh i3/xmonad vim/emacs rxvt-unicode tmux mpv/cmus conky/xmobar mutt ERC
brisbin33 zsh xmonad vim rxvt-unicode screen dzen mutt irssi
BVollmerhaus fish i3-gaps kakoune rxvt-unicode polybar thunderbird
cinelli zsh dwm vim termite-git pianobar htop mutt-kz weechat
dikiaap zsh i3-gaps neovim alacritty tmux i3blocks
Earnestly zsh i3/orbment vim/emacs termite tmux mpd conky mutt weechat
ErikBjare zsh xmonad/xfce4 vim terminator tmux xfce4-panel weechat
falconindy bash i3 vim rxvt-unicode ncmpcpp conky mutt
graysky zsh xfce4 vim terminal ncmpcpp custom thunderbird
hugdru zsh awesome neovim rxvt-unicode tmux thunderbird weechat
insanum bash herbstluftwm vim evilvte tmux dzen mutt-kz
jasonwryan bash/zsh dwm vim rxvt-unicode tmux ncmpcpp custom mutt irssi
jdevlieghere zsh xmonad vim terminal tmux htop mutt weechat
jelly zsh i3 vim termite tmux ncmpcpp mutt-kz-git weechat
maximbaz zsh i3-gaps neovim kitty py3status thunderbird
mehalter zsh i3-gaps neovim termite tmux gpymusic i3blocks, gotop neomutt weechat
meskarune bash herbstluftwm vim rxvt-unicode screen conky weechat
neersighted zsh i3 vim rxvt-unicode tmux ncmpcpp htop mutt irssi
oibind fish awesome neovim termite htop-vim weechat
OK100 bash dwm vim rxvt-unicode cmus conky, dzen mutt weechat
pablox-cl zsh (zplug) gnome3 neovim kitty
reisub0 fish qtile neovim kitty mpd conky
sistematico zsh/fish/bash i3-gaps vim/nano termite tmux ncmpcpp polybar mutt weechat
sitilge zsh awesome neovim termite thunderbird
swalladge zsh/bash i3 neovim/vim termite tmux cmus i3pystatus mutt
SyfiMalik zsh i3 vim rxvt-unicode tmux ncmpcpp/mpd polybar mutt weechat
thiagowfx bash i3 vim/emacs tilix i3blocks
vodik zsh xmonad vim termite-git tmux ncmpcpp custom mutt weechat
w0ng zsh dwm vim rxvt-unicode tmux ncmpcpp custom mutt irssi
whitelynx fish i3 neovim kitty i3pystatus
Wintervenom bash herbstluftwm vim rxvt-unicode screen mpd (mpc-utils) hlwm-dzen2 mutt weechat
wolfcore bash dwm vim rxvt-unicode tmux cmus custom weechat
zendeavor zsh i3 vim rxvt-unicode tmux ncmpcpp i3status weechat

See also