bash based dotfiles management framework
This script makes it easy to manage your dotfiles.
Script is written in bash, and very configurable.
You can use it for multi-machines usage, setup for new machine, daily watering to your dotfiles repository, etc...
Configuration file is in 'dotrc'. Link relation table is in 'dotlink'.
- Pull remote dotfile repository (by git).
dot pull
- Make symbolic link interactively.
This command sets symbolic links configured in 'dotlink'.(If you have your file already, you can choose the operation interactively: show diff, edit these files, overwrite, make-backup or do-nothing). With option "-i", this script runs without interaction mode and with "-v", this script shows verbose message.
dot set [-i][-v]
- Move the new file to the dotfile dir, make the link, and edit 'dotlink'.
dot add some_file [~/.dotfiles/path/to/the/file]
- Unlink the selected symbolic links and copy its original files from the dotfile directory.
dot unlink <link> [<link> <link> ... ]
- Remove the all symbolic link written in the dotlink file
$dotlink
.
dot clear
- Clone (my) dotfile repository on your computer.
dot clone [<dir_to_clone>]
You can add dotrc.local
and dotlink.local
on each computers and don't have to divide dotfiles repository.
Share or don't share the configuration what you want.
dot pull
provides you fresh dotfiles anywhere.
If you have your own dotfiles already and manage with dot
, just:
- Install git and dot.
- Clone to your computer.
- Edit
dotrc
like below:
# You can change the dotfiles to clone
clone_repository='https://github.com/yourusername/dotfiles.git'
- And just run
dot clone && dot set
If you want to add your new configuration file to your dotfiles repository, just run
dot add newfile
Then the script asks you like:
Suggestion:
dot add -m '' newfile /home/username/.dotfiles/newfile
Continue? [y/N]'
Type y
and Enter
, then move newfile
to /home/username/.dotfiles/newfile
and make symbolic link to newfile
and this link information is written in dotlink
Other things you should do is git commit
and git push
to your repository.
(Or if you use Dropbox or so, you can skip these steps.)
- bash
- git
- clone this repository on your computer:
git clone https://github.com/ssh0/dot ~/.git/dot
- make:
sudo make install
- copy sample configuratoin files to your repository:
make copy-config
will copy examples/dotrc
and examples/dotlink
to ~/.dotfiles
.
You can modify where to copy:
make copy-config DOTDIR=-$HOME/dotfiles
done.
- [optional] copy local settings if you want:
make copy-local-config
You can modify where to copy (default: $HOME/.config/dot/
)
make copy-local-config USERCONFDIR=-$HOME/.dot
In order to add link-relation-table already exists, just
dot add <link1> <link2> <link2> <link3> ...
- test in other OS (I use some Ubuntu 14.04 machines and only tested in there)
This project is under MIT license.
If you improve this project, find bugs or have a question, feel free to contact me.