dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 1db839562dd7240eac36aa5ab17cd2d34f1840eb
parent a89cfe310d96b4d67aa985dafe3e293cae4bdd48
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Wed, 27 Sep 2017 12:26:14 -0700

update create_symlinks script to automatically select and link files

Diffstat:
M.config/surfraw/conf | 2+-
A.gitignore | 2++
AREADME.md | 8++++++++
DREADME.rst | 10----------
Mcreate_symlinks.sh | 75++++++++++++++++++++++++---------------------------------------------------
5 files changed, 35 insertions(+), 62 deletions(-)

diff --git a/.config/surfraw/conf b/.config/surfraw/conf @@ -1,3 +1,3 @@ -SURFRAW_text_browser=/usr/local/bin/w3m +SURFRAW_text_browser=w3m SURFRAW_graphical=no SURFRAW_graphical_browser=open diff --git a/.gitignore b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +tags diff --git a/README.md b/README.md @@ -0,0 +1,8 @@ +# dotfiles + +Configuration files for zsh, vim, tmux, X, etc. Licensed under GPL v. 3. + +After cloning the repository, create symbolic links to your home folder using: + + ./install.sh + diff --git a/README.rst b/README.rst @@ -1,10 +0,0 @@ -dotfiles -======== - -Configuration files for zsh, vim, tmux, X, etc. -Licensed under GPL v. 3. - -After cloning the repository, create symbolic links from the configuration files -of this repository to your home folder using:: - ./install.sh - diff --git a/create_symlinks.sh b/create_symlinks.sh @@ -1,65 +1,38 @@ #!/bin/bash -# Home folder dotfiles -for F in .bashrc .vimrc .inputrc .tmux.conf .xpdfrc .signature .Xresources \ - .Xmodmap .xinitrc .xprofile .zshrc .conkyrc .xbindkeysrc .gitconfig \ - .vimperatorrc .vimpcrc .compton.conf .locale .ctags .spacemacs \ - .juliarc.jl .mailcap .offlineimaprc .msmtprc .notmuch-config; do - SOURCE=$PWD/$F - TARGET=~/$F +# Create folders +mkdir -p ~/bin +mkdir -p ~/.ipython/profile_default +mkdir -p ~/.mutt/cache +chmod 0700 ~/.mutt/cache - # Check if file exists, rename if so - [ -f $TARGET ] && mv $TARGET ${TARGET}_bck - rm $TARGET +shopt -s dotglob +for f in *; do - echo "Symlink: $SOURCE -> $TARGET" - ln -s $SOURCE $TARGET -done + # Skip . and .. + [ "$f" = "." ] && continue + [ "$f" = ".." ] && continue -mkdir -p ~/.ipython/profile_default -# Home folder dotfolders -for F in .colors .config/uzbl .config/awesome .config/dwb .config/bspwm \ - .config/sxhkd .config/luakit .config/openbox .config/zathura .tmuxinator \ - .i3 .mutt .ncmpcpp .vim .vimperrator .w3m wallpapers .kwm .mpd \ - .imapfilter .weechat .ipython/profile_default/ipython_config.py \ - .config/surfraw; do - SOURCE=$PWD/$F - TARGET=~/$F + # Skip shell scripts and markdown + [ "${f##*.}" = "sh" ] && continue + [ "${f##*.}" = "md" ] && continue - # Check if file exists, rename if so - [ -f $TARGET ] && mv $TARGET ${TARGET}_bck - rm -rf $TARGET + # Do not symlink these files/directories + [[ "$f" =~ tags|.git/|.DS_Store|bar|userChrome.css ]] && continue - echo "Symlink: $SOURCE -> $TARGET" - ln -s $SOURCE $TARGET -done + # .xinitrc doesn't work with XQuartz + [[ "$(uname)" = "Darwin" && "$f" == ".xinitrc" ]] && continue -mkdir -p ~/bin -# Home folder bin directory -for F in `ls bin/`; do - SOURCE=$PWD/bin/$F - TARGET=~/bin/$F + SOURCE=$PWD/$f + TARGET=~/$f + + # Skip symlink generation if the link already exists + [ -L $TARGET ] && continue - # Check if file exists, rename if so + # Rename any original files or directories [ -f $TARGET ] && mv $TARGET ${TARGET}_bck - rm -rf $TARGET + [ -d $TARGET ] && mv $TARGET ${TARGET}_bck echo "Symlink: $SOURCE -> $TARGET" ln -s $SOURCE $TARGET done - -# .xinitrc doesn't work with XQuartz -if [[ "$UNAMESTR" == 'Darwin' ]]; then - rm ~/.xinitrc -fi - -# Neovim configuration symlinks -cd $HOME -mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config} -ln -s ~/.vim $XDG_CONFIG_HOME/nvim -ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim -cd - - -# Mutt cache folder -mkdir -p ~/.mutt/cache -chmod 0700 ~/.mutt/cache