Code Monkey home page Code Monkey logo

dm's Introduction

dm: Dotfile Manager

A single-file "dotfile" manager written in POSIX shell. It creates and synchronises symlinks in your home directory to a central dotfile source.

Usage

The script expects your dotfiles master to be in ~/.dotfiles or have the ENV variable DOTFILES set to the path. This master path can then be kept in revision control and be kept clean. The script will symbolically link files from the master path to your home directory.

dm check will list all files needing linking.

dm sync will link all files to your home directory.

dm add <file> will move the file into the master and then link it.

Each command has optional flags which modify the default behaviour as the usage help describes below:

Options:
    -v        Be noisy
    -s <path> Specify dotfile path (default: ~/.dotfiles)
    -f        Force. Replace symlinks and no backups (sync)
    -h        This help

FAQs

Q: What about deeply nested files?

A: All parent directories that do not exist will be created in your home directory. This enables linking only files. For example:

~
|-- blah
\-- bin
    \-- nested
        \-- foo -> ~/.dotfiles/bin/nested/foo

The nested and foo directories above will be created if need be.

Q: How do I clean up old symlinks?

A: Manually. I have not yet had the time/motivation to work out how to see if the broken symlink is pointing to a missing file in the dotfiles source.

Q: What about host specific files?

A: By creating a file in your dotfiles with the suffix .__$(hostname -s) then dm will use it in place of the general version. To exclude a file for a particular host then append yet another suffix of ! like this (for the host "acme"):

~
|-- blah
\-- bin
    |-- somefile
    |-- somefile.__acme -> ~/.dotfiles/bin/somefile
    |-- anotherfile
    \-- anotherfile.__acme!

Author

Felix Hanley [email protected]

License

MIT

dm's People

Contributors

felix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tabulon-ext

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.