diff options
-rw-r--r-- | .i3/Makefile | 8 | ||||
-rw-r--r-- | .mr/mrconfig (renamed from .mrconfig) | 28 | ||||
-rw-r--r-- | .mr/mrtrust | 1 | ||||
-rw-r--r-- | .mutt/Makefile | 19 | ||||
-rw-r--r-- | .offlineimap/Makefile | 13 | ||||
-rw-r--r-- | .uzbl/Makefile | 13 | ||||
-rw-r--r-- | .vim/Makefile | 16 | ||||
-rw-r--r-- | .zathura/Makefile | 10 | ||||
-rw-r--r-- | .zathurarc (renamed from .zathura/zathurarc) | 0 | ||||
-rw-r--r-- | .zsh/Makefile | 17 | ||||
-rw-r--r-- | Makefile | 5 | ||||
-rwxr-xr-x | bin/dot | 58 | ||||
-rw-r--r-- | install.yaml | 47 |
13 files changed, 120 insertions, 115 deletions
diff --git a/.i3/Makefile b/.i3/Makefile deleted file mode 100644 index ccbbffa..0000000 --- a/.i3/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -HOME=/home/urbain -TARGET=$(HOME)/.config/i3 - -$(TARGET) : - rm -f $@ && ln -s $(PWD) $@ - -clean : - rm -f $(TARGETS) @@ -1,24 +1,24 @@ -[.] +[dotfiles] checkout = git clone 'git@github.com:uvaes/dotfiles' 'dotfiles' -[.passwords] -checkout = git clone 'git@github.com:uvaes/passwords' '.passwords' - -[.zsh/zgen] -checkout = git clone 'https://github.com/tarjoilija/zgen' 'zgen' -skip = [ "$1" = push ] +[dotfiles/.personal] +checkout = git clone 'git@github.com:uvaes/personal' '.personal' -[.vim/vim-plug] +[dotfiles/.vim/vim-plug] checkout = git clone 'https://github.com/junegunn/vim-plug' 'vim-plug' skip = [ "$1" = push ] -[.urxvt/ext] -checkout = git clone 'https://github.com/muennich/urxvt-perls' 'ext' +[dotfiles/.mutt/solarized] +checkout = git clone 'https://github.com/altercation/mutt-colors-solarized' 'solarized' skip = [ "$1" = push ] -[.mutt/solarized] -checkout = git clone 'https://github.com/altercation/mutt-colors-solarized' 'solarized' +[dotfiles/.zsh/zgen] +checkout = git clone 'https://github.com/tarjoilija/zgen' 'zgen' skip = [ "$1" = push ] -[.personal] -checkout = git clone 'git@github.com:uvaes/personal' '.personal' +[dotfiles/.passwords] +checkout = git clone 'urbain@urbainvaes.com:git/passwords.git' '.passwords' + +[dotfiles/.urxvt/ext] +checkout = git clone 'https://github.com/muennich/urxvt-perls' 'ext' +skip = [ "$1" = push ] diff --git a/.mr/mrtrust b/.mr/mrtrust new file mode 100644 index 0000000..aa0f340 --- /dev/null +++ b/.mr/mrtrust @@ -0,0 +1 @@ +~/Dropbox/phd/.mrconfig diff --git a/.mutt/Makefile b/.mutt/Makefile deleted file mode 100644 index a4b94ce..0000000 --- a/.mutt/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -HOME=/home/urbain -TARGETS=$(addprefix $(HOME)/,.mutt .mutt/temp .mutt/cache .mutt/cache/bodies) - -all : $(TARGETS) - -$(HOME)/.mutt : - rm -f $@ && ln -s $(PWD) $@ - -$(HOME)/.mutt/temp : - mkdir -p $@ - -$(HOME)/.mutt/cache : - mkdir -p $@ - -$(HOME)/.mutt/cache/bodies : - mkdir -p $@ - -clean : - rm -f $(TARGETS) diff --git a/.offlineimap/Makefile b/.offlineimap/Makefile deleted file mode 100644 index afb339c..0000000 --- a/.offlineimap/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -HOME=/home/urbain -TARGETS=$(HOME)/.offlineimaprc $(HOME)/.offlineimap.py - -all : $(TARGETS) - -$(HOME)/.offlineimaprc : - ln -s $(PWD)/offlineimaprc $@ - -$(HOME)/.offlineimap.py : - ln -s $(PWD)/offlineimap.py $@ - -clean : - rm -f $(TARGETS) diff --git a/.uzbl/Makefile b/.uzbl/Makefile deleted file mode 100644 index 1c45cec..0000000 --- a/.uzbl/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -HOME=/home/urbain -TARGETS=$(addprefix $(HOME)/,.config/uzbl .local/share/uzbl/bookmarks) - -all : $(TARGETS) - -$(HOME)/.config/uzbl : - rm -f $@ && ln -s $(PWD) $@ - -$(HOME)/.local/share/uzbl/bookmarks : - rm -f $@ && ln -s $(PWD)/bookmarks $@ - -clean : - rm -f $(TARGETS) diff --git a/.vim/Makefile b/.vim/Makefile deleted file mode 100644 index 6e07c30..0000000 --- a/.vim/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -HOME=/home/urbain -TARGETS=$(addprefix $(HOME)/,.vimrc .vim .vim/vimundo) - -all : $(TARGETS) - -$(HOME)/.vimrc : - rm -f $@ && ln -s $(PWD)/vimrc $@ - -$(HOME)/.vim : - rm -f $@ && ln -s $(PWD) $@ - -$(HOME)/.vim/vimundo : - mkdir -p $@ - -clean : - rm -f $(TARGETS) diff --git a/.zathura/Makefile b/.zathura/Makefile deleted file mode 100644 index c88ecfc..0000000 --- a/.zathura/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -HOME=/home/urbain -TARGET=$(HOME)/.config/zathura/zathurarc - -all : $(TARGET) - -$(HOME)/.config/zathura/zathurarc : - ln -sf $(PWD)/zathurarc $@ - -clean : - rm -f $(TARGET) diff --git a/.zathura/zathurarc b/.zathurarc index 543633d..543633d 100644 --- a/.zathura/zathurarc +++ b/.zathurarc diff --git a/.zsh/Makefile b/.zsh/Makefile deleted file mode 100644 index 74a4bfc..0000000 --- a/.zsh/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -HOME=/home/urbain -TARGETS=$(addprefix $(HOME)/,.zsh .zshrc .zgen) - -all : $(TARGETS) - -$(HOME)/.zshrc : - rm -f $@ && ln -s $(PWD)/zshrc $@ - -$(HOME)/.zsh : - rm -f $@ && ln -s $(PWD) $@ - -$(HOME)/.zgen : $(PWD)/zgen - cp -r $(PWD)/zgen $@ - -clean : - rm -f $(HOME)/.zsh $(HOME)/.zshrc - rm -rf $(HOME)/.zgen diff --git a/Makefile b/Makefile deleted file mode 100644 index 0ee52ec..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all : - ./bin/install - -clean : - ./bin/clean @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +import os +import sys +import yaml + +# Colors for terminal +from termcolor import colored + + +# Path of dotfiles +dotpath = '/home/urbain/dotfiles' + +# Load yaml configuration file +with open(dotpath + "/install.yaml", 'r') as stream: + config = yaml.load(stream) + +# Special symlinks +special_symlinks = set(config['special'].keys()) + +# All files in dir +normal_symlinks = set(os.listdir(dotpath)) - set(config['exclude']) + + +def perform(action): + + # Command to execute + command = config['commands'][action] + + for f in special_symlinks | normal_symlinks: + + # Print filename + print('[' + colored(f, 'green') + ']') + + if f in config['pre']: + print(config['pre'][f]) + os.system(config['pre'][f]) + + # Target of symlink + if f in special_symlinks: + t = config['special'][f] + elif f in normal_symlinks: + t = config['default'].format(file=f) + + if t != "": + # Formatted command + formatted = command.format(file=f, path=dotpath, target=t) + + # Print & execute command + print(formatted) + os.system(formatted) + + else: + print("Nothing to do!") + + print('\n') + +perform(sys.argv[1]) diff --git a/install.yaml b/install.yaml new file mode 100644 index 0000000..ee91571 --- /dev/null +++ b/install.yaml @@ -0,0 +1,47 @@ +exclude: + - '.personal' + - '.git' + - '.gitignore' + - 'install.yaml' + - 'README.md' + +# Commands to install / uninstall symlinks +commands: + up: rm -rf {target} && ln -s {path}/{file} {target} + down: rm -rf {target} + +# Default target +default: ~/{file} + +# Special targets +special: + + .i3: ~/.config/i3 + + .mr/mrconfig: ~/.mrconfig + .mr/mrtrust: ~/.mrtrust + + .offlineimap: "" + .offlineimap/offlineimaprc: ~/.offlineimaprc + .offlineimap/offlineimap.py: ~/.offlineimap.py + + .vim/.vimrc: ~/.vimrc + .zathurarc: ~/.config/zathura/zathurarc + + .zsh/zgen: ~/.zgen + .zsh/zshrc: ~/.zshrc + + .uzbl: ~/.config/uzbl + .uzbl/bookmarks: ~/.local/share/uzbl/bookmarks + + .passwords: ~/.password-store + +# Additional actions before symlink +pre: + .mutt: | + mkdir -p .mutt/temp + mkdir -p .mutt/cache + mkdir -p .mutt/bodies + + .vim: | + mkdir -p .vim/vimundo |