GithubHelp home page GithubHelp logo

dotfiles's Introduction

dotfiles

As the name implies, this script is a tool for managing your dotfiles.

Concept

Let your dotfiles live where they want and records their changes. Only selected dotfiles are tracked for changes. If you track a directory, that directory is watched for new files.

When a change or new file is found, the change is pulled into the git repository.

Setup

Fork or clone this repository.

shell> cd ~/git/
shell> git clone https://github.com/FragmentedCurve/dotfiles.git

I recommend setting an alias for the dotfiles.sh script.

shell> alias dotfiles=~/git/dotfiles/dotfiles.sh

In addition to the alias, I recommend creating a branch other than the main (or master) branch for tracking dotfiles.

shell> dotfiles git checkout -b mybranch

Tracking dotfiles

Tracking a dotfile is as easy as doing,

shell> dotfiles track .muttrc
::: COPY     _muttrc

The filename .muttrc is relative to ~/. Filenames in the git repo have their "." replaced with an "_". You can list the files being tracked by doing,

shell> dotfiles ls
_muttrc

To watch for new files in a specific directory, you can track the directory,

shell> dotfiles track ~/.mutt
::: MKDIR    _mutt
::: WATCH    _mutt

Now when we do a pull, new files in ~/.mutt will be tracked automatically.

shell> touch ~/.mutt/foobar
shell> dotfiles pull
::: COPY     _mutt/foobar

We can see the directories we're watching by doing,

shell> dotfiles watching
_mutt

Checking the Diffs

If you want to see what the difference between your system dotfile and the git repo, you can do,

shell> dotfiles diff .muttrc
--- _muttrc     2021-11-12 09:51:06.443690988 -0500
+++ /home/user/.muttrc  2021-11-12 10:00:52.937004607 -0500
@@ -55,3 +55,4 @@
#### Fetch Mail
macro generic,index,pager G "<shell-escape>mbsync privateemail<Enter>" "offlineimap"
macro generic,index,pager I "<shell-escape>imapfilter<Enter>" "imapfilter"
+# Foobar

Running dotfiles diff without an arg will loop through all the changes.

dotfiles's People

Contributors

fragmentedcurve avatar

Watchers

 avatar  avatar

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.