dotpkg is a dotfile package manager for *nix shell users.
-
Choose a location in your home directory (or elsewhere) to store packages.
mkdir -p ~/dotfiles/packages
-
Install dotpkg:
git clone http://github.com/aghast/dotpkg ~/dotfiles/packages/dotpkg
-
Update your .profile, .bashrc, .login, or whatever startup file:
Sample
.bashrc
:# ... # Load dotpkg {{{ eval `$HOME/dotfiles/packages/dotpkg/dotpkg -s` # Let dotpkg manage dotpkg dotpkg 'aghast/dotpkg' # }}} # Dotfile packages {{{ dotpkg 'bitbucket/foo/bar' dotpkg 'http://mycompany.com/gitrepo/a-package.git' # }}}
-
Install configured dotpkgs - open a new shell window (you may need a login window if you installed in a login-only script).
-
Profit!
dotpkg allows you to easily:
- install dotfile packages without having to think about how your files are organized
- clean up unused scripts and hacks
- ignore how the author's files are organized
- forget worrying about installing scripts in
~/bin
using cp, install, symlinks - publish your clever dotfile ideas to others without a super-formal structure
dotpkg will work fine as shown above. But you may want to customize the behavior somewhat. Here are some things you can change:
# Directory containing the dotpkg files [default: $(dirname $(which dotpkg)) ]
DOTPKG_DIR=...
export DOTPKG_DIR
# List of directories to search for dotpkgs. (default: $DOTPKG_DIR)
DOTPKG_PATH=/usr/local/share/etc/dotpkg:$HOME/dotfiles/dotpkg
export DOTPKG_DIR
# Directory to write new dotpkgs. (default: last entry in $DOTPKG_PATH)
DOTPKG_STORE=$HOME/dotfiles/dotpkg
export DOTPKG_DIR
# List of suffixes to use for this shell (default: based on $SHELL)
DOTPKG_SUFFIXES=".bash .sh"
export DOTPKG_SUFFIXES
# Default repo host (default: github)
DOTPKG_DEFAULT_REPO=gitorious
export DOTPKG_DEFAULT_REPO
Say you have a really clever dotfile trick for your shell. You want to share this with others, but don't know how.
Make a directory - this will be your "project." Put the directory under control of your favorite VCS tool.
~$ mkdir coolidea
~/coolidea$ cd coolidea
~/coolidea$ git init
Initialized empty Git repository in ~/coolidea/.git/
(master) ~/coolidea$
Now, create a file called autoload.sh
(or .bash, .csh, .ksh, .zsh) depending on the minimum shell required to use the script.
If you need it, you can also create logout.sh
(or .bash, .csh, etc.) to run when the user logs out.
Once your script is set up, check in your changes and share them with the world.
```sh
(master) ~/coolidea$ git commit -m "My gift to a grateful world"
(master) ~/coolidea$ git push
```
Now other users can install and use your cool idea, without have to know anything about the implementation details. (That's your problem!)
dotpkg was inspired directly by the awesome Vundle package by gmarik. Thanks, dude - you rock!
dotpkg was developed using Vim 7.3, using Bash on Mac OSX 10.8.4 (Mountain Lion).
- Port to other systems, particularly zsh.
- Add support for csh-variants.
- Add verbose mode to show package operations.