Skip to content

Instantly share code, notes, and snippets.

@racklin
Forked from Jamesits/dotfiles-utility.sh
Created June 20, 2018 18:16
Show Gist options
  • Select an option

  • Save racklin/cb43e7e0f64329ad0e590e482424c53c to your computer and use it in GitHub Desktop.

Select an option

Save racklin/cb43e7e0f64329ad0e590e482424c53c to your computer and use it in GitHub Desktop.

Revisions

  1. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/usr/bin/env bash

    # dotfiles utility
    # dotfiles utility - https://gist.github.com/Jamesits/9bc4adfb1f299380c79e
    # Set $DOTFILES to where you want to put your dotfiles.
    # then run dotfiles-init someSoftware,
    # and it will move all files starting with `.someSoftware` to the correct location
  2. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -97,7 +97,8 @@ dotfiles-init() {
    popd >/dev/null 2>&1
    }

    # rebuild all links - useful when you are recovering settings to a new OS
    # rebuild links - useful when you are recovering settings to a new OS
    # run `dotfiles-rebuild *` to rebuild all at once
    dotfiles-rebuild() {
    stow --dir=$DOTFILES --target=$HOME -vv $@
    }
  3. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    # then link them back,
    # Which will produce a directory structure like:
    #
    # $ tree -aL 2 Dropbox/Code/config/dotfiles/
    # $ tree -aL 2 ~/Dropbox/Code/config/dotfiles/
    # Dropbox/Code/config/dotfiles/
    # ├── AndroidStudio
    # │   └── .AndroidStudio1.5
  4. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -75,15 +75,18 @@
    # └── .zshrc
    #

    # Where to store your actual config files
    export DOTFILES=~/Dropbox/Code/config/dotfiles

    # List unlinked dotfiles
    dotfiles-count() {
    pushd >/dev/null 2>&1
    cd $HOME
    ls -ald .* | grep -v ^l | tee >(wc -l)
    popd >/dev/null 2>&1
    }

    # Move and link files named `.something*`
    dotfiles-init() {
    pushd >/dev/null 2>&1
    cd $HOME
    @@ -94,6 +97,7 @@ dotfiles-init() {
    popd >/dev/null 2>&1
    }

    # rebuild all links - useful when you are recovering settings to a new OS
    dotfiles-rebuild() {
    stow --dir=$DOTFILES --target=$HOME -vv $@
    }
  5. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -95,5 +95,5 @@ dotfiles-init() {
    }

    dotfiles-rebuild() {
    stow --dir=$DOTFILES --target=$HOME -vv $1
    stow --dir=$DOTFILES --target=$HOME -vv $@
    }
  6. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -93,3 +93,7 @@ dotfiles-init() {
    stow --dir=$DOTFILES --target=$HOME -vv $1
    popd >/dev/null 2>&1
    }

    dotfiles-rebuild() {
    stow --dir=$DOTFILES --target=$HOME -vv $1
    }
  7. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    # then link them back,
    # Which will produce a directory structure like:
    #
    # $ tree -a Dropbox/Code/config/dotfiles/ -L 2
    # $ tree -aL 2 Dropbox/Code/config/dotfiles/
    # Dropbox/Code/config/dotfiles/
    # ├── AndroidStudio
    # │   └── .AndroidStudio1.5
  8. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,9 @@

    # dotfiles utility
    # Set $DOTFILES to where you want to put your dotfiles.
    # then run dotfiles-init someSoftware,
    # and it will move all files starting with `.someSoftware` to the correct location
    # then link them back,
    # Which will produce a directory structure like:
    #
    # $ tree -a Dropbox/Code/config/dotfiles/ -L 2
  9. @Jamesits Jamesits revised this gist Mar 11, 2016. 1 changed file with 70 additions and 1 deletion.
    71 changes: 70 additions & 1 deletion dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,76 @@
    #!/usr/bin/env bash

    # dotfiles utility
    #
    # Set $DOTFILES to where you want to put your dotfiles.
    # Which will produce a directory structure like:
    #
    # $ tree -a Dropbox/Code/config/dotfiles/ -L 2
    # Dropbox/Code/config/dotfiles/
    # ├── AndroidStudio
    # │   └── .AndroidStudio1.5
    # ├── PyCharm
    # │   └── .PyCharm50
    # ├── X
    # │   └── .Xauthority
    # ├── android
    # │   └── .android
    # ├── atom
    # │   └── .atom
    # ├── bash
    # │   ├── .bash_history
    # │   ├── .bash_sessions
    # │   └── .bashrc
    # ├── cordova
    # │   └── .cordova
    # ├── cups
    # │   └── .cups
    # ├── docker
    # │   └── .docker
    # ├── dropbox
    # │   └── .dropbox
    # ├── gem
    # │   └── .gem
    # ├── git
    # │   ├── .gitconfig
    # │   └── .gitignore_global
    # ├── gnuradio
    # │   └── .gnuradio
    # ├── gradle
    # │   └── .gradle
    # ├── hg
    # │   └── .hgignore_global
    # ├── ionic
    # │   └── .ionic
    # ├── iterm2
    # │   ├── .iterm2_shell_integration.bash
    # │   └── .iterm2_shell_integration.zsh
    # ├── matplotlib
    # │   └── .matplotlib
    # ├── npm
    # │   └── .npm
    # ├── oh-my-zsh
    # │   └── .oh-my-zsh
    # ├── oracle_jre
    # │   └── .oracle_jre_usage
    # ├── python
    # │   └── .python_history
    # ├── ssh
    # │   └── .ssh
    # ├── subversion
    # │   └── .subversion
    # ├── vim
    # │   └── .viminfo
    # ├── vscode
    # │   └── .vscode
    # ├── w3m
    # │   └── .w3m
    # ├── wget
    # │   └── .wget-hsts
    # └── zsh
    # ├── .zsh-update
    # ├── .zsh_history
    # └── .zshrc
    #

    export DOTFILES=~/Dropbox/Code/config/dotfiles

  10. @Jamesits Jamesits created this gist Mar 11, 2016.
    23 changes: 23 additions & 0 deletions dotfiles-utility.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/usr/bin/env bash

    # dotfiles utility
    #

    export DOTFILES=~/Dropbox/Code/config/dotfiles

    dotfiles-count() {
    pushd >/dev/null 2>&1
    cd $HOME
    ls -ald .* | grep -v ^l | tee >(wc -l)
    popd >/dev/null 2>&1
    }

    dotfiles-init() {
    pushd >/dev/null 2>&1
    cd $HOME
    ls -ald .$1*;
    mkdir -p $DOTFILES/$1;
    mv .$1* $DOTFILES/$1;
    stow --dir=$DOTFILES --target=$HOME -vv $1
    popd >/dev/null 2>&1
    }