Package: dotdrop
dotdropSave your dotfiles once, deploy them everywhereDotdropmakes the management of dotfiles between different hosts easy.
It allows you to store your dotfiles in Git and automagically deploy
different versions of the same file on different setups.It also allows to manage differentsetsof dotfiles.
For example, you can have a set of dotfiles for your home laptop and
a different set for your office desktop. Those sets may overlap, and different
versions of the same dotfiles can be deployed using different predefinedprofiles.
Or you may have a main set of dotfiles for your
everyday host and a subset you only need to deploy to temporary
hosts (cloud VM etc.) that may be using
a slightly different version of some of the dotfiles.Features:Sync once every dotfile in Git for different usagesAllow dotfile templatingDynamically generated dotfile contents with pre-defined variablesComparison between deployed and stored dotfilesHandling multiple profiles with different sets of dotfilesEasily import and update dotfilesHandle files and directoriesSupport symlinking of dotfilesAssociate actions to the deployment of specific dotfilesAssociate transformations for storing encrypted/compressed dotfilesProvide solutions for handling dotfiles containing sensitive informationCheck theexample, thedocumentationor
howpeople are using dotdropfor more.Quick start:## using dotdrop as a submodulemkdirdotfiles&&cddotfiles
gitinit
gitsubmoduleaddhttps://github.com/deadc0de6/dotdrop.git
pip3install-rdotdrop/requirements.txt--user
./dotdrop/bootstrap.sh
./dotdrop.sh--helpA mirror of this repository is available on GitLab underhttps://gitlab.com/deadc0de6/dotdrop.Why dotdrop?There exist many tools to manage dotfiles; however, not
many allow to deploy different versions of the same dotfile
on different hosts. Moreover, dotdrop allows to specify the
set of dotfiles that need to be deployed for a specific profile.See theexamplefor a concrete example of
whydotdroprocks.Table of ContentsInstallationGetting startedDocumentationThank youInstallationSee theinstallation instructions.Dotdrop is available on:PyPIHomebrewAUR (stable)AUR (git version)SnapcraftPacstallGetting startedCreate a new repositoryto store your dotfiles with dotdrop.Initorclonethat new repository andinstall dotdrop.Then import any dotfiles (files or directories) you want to manage with dotdrop.
You can either use the default profile (which resolves to thehostnameof the host
you are running dotdrop on) or provide it explicitly using the switch-p/--profile.Import dotfiles on hosthome:$dotdropimport~/.vimrc~/.xinitrc~/.config/polybarDotdrop does two things:Copy the dotfiles to thedotpathdirectory
(defined inconfig.yaml, defaults todotfiles)Create the associated entries in theconfig.yamlfile
(in thedotfilesandprofilesentries)Your config file will look like something similar to this:config:backup:truebanner:truecreate:truedotpath:dotfilesignoreempty:falsekeepdot:falselongkey:falseshowdiff:falseworkdir:~/.config/dotdropdotfiles:d_polybar:dst:~/.config/polybarsrc:config/polybarf_vimrc:dst:~/.vimrcsrc:vimrcf_xinitrc:dst:~/.xinitrcsrc:xinitrcprofiles:home:dotfiles:-f_vimrc-f_xinitrc-d_polybarFor a description of the different fields and their use,
see theconfig doc.Commit and push your changes with git.Then go to another host where your dotfiles need to be managed as well,
clone the previously set up repository,
and compare the local dotfiles with the ones stored in dotdrop:$dotdropcompare--profile=homeNow you might want to adapt theconfig.yamlfile to your liking on
that second host. Let's say, for example, that you only wantd_polybarandf_xinitrcto be deployed on that second host. You would then change your config
to something like this (assuming that the second host's hostname isoffice):…profiles:home:dotfiles:-f_vimrc-f_xinitrc-d_polybaroffice:dotfiles:-f_xinitrc-d_polybarThen adapt any dotfile using thetemplatingfeature (if needed). For example, you might want different fonts sizes in Polybar for each host.Edit<dotpath>/config/polybar/config:…{%@@ifprofile=="home"@@%}font0=sans:size=10;0{%@@elifprofile=="office"@@%}font0=sans:size=14;0{%@@endif@@%}font1="Material Design Icons:style=Regular:size=14;0"font2="unifont:size=6;0"…You also want to have the correct interface set on the wireless network in
the Polybar config.Add avariableto the config file (In the below example,homegets the defaultwlan0value for
the variablewifiwhileofficegetswlp2s0):…variables:wifi:"wlan0"…profiles:home:dotfiles:-f_vimrc-f_xinitrc-d_polybaroffice:dotfiles:-f_xinitrc-d_polybarvariables:wifi:"wlp2s0"Then you can adapt the Polybar config file so that the
variablewifigets correctly replaced during installation:[module/wireless-network]type=internal/networkinterface={{@@wifi@@}}Also, the home computer is runningawesomeWM,
and the office computerbspwm.
The~/.xinitrcfile will therefore be different while still sharing some lines.Edit<dotpath>/xinitrc:#!/bin/bash# load Xresourcesuserresources=$HOME/.Xresourcesif[-f"$userresources"];thenxrdb-merge"$userresources"&fi# launch the wm{%@@ifprofile=="home"@@%}execawesome{%@@elifprofile=="office"@@%}execbspwm{%@@endif@@%}Finally you want everything installed with theofficeprofile
to be logged; you thus add an action to the config file:…actions:loginstall:"echo{{@@_dotfile_abs_src@@}}installedto{{@@_dotfile_abs_dst@@}}>>{0}"…profiles:home:dotfiles:-f_vimrc-f_xinitrc-d_polybaroffice:dotfiles:-f_xinitrc-d_polybarvariables:wifi:"wlp2s0"actions:-loginstall "/tmp/dotdrop-installation.log"When done, you can install your dotfiles using:$dotdropinstallIf you are unsure, you can always rundotdrop compareto see
how your local dotfiles would be updated by dotdrop before runninginstallor you could run install with--dry.That's it, a single repository with all your dotfiles for your different hosts.For more, see thedocs:Create actionsUse transformationsUse variablesSymlink dotfilesand moreDocumentationDotdrop's documentation is hosted onRead the Docs.Thank youIf you like dotdrop,buy me a coffee.ContributionIf you are having trouble installing or using dotdrop,open an issue.If you want to contribute, feel free to do a PR (please follow PEP8).
Have a look at thecontribution guidelines.LicenseThis project is licensed under the terms of the GPLv3 license.