From 5577ee29b4162a2dfa222b525f27a17485851b7e Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Thu, 3 Sep 2015 18:02:48 -0700 Subject: [PATCH] Refactor to include non-dotfile files. --- ackrc => dotfiles/ackrc | 0 aliases => dotfiles/aliases | 0 bashrc => dotfiles/bashrc | 0 {byobu => dotfiles/byobu}/.tmux.conf | 0 {byobu => dotfiles/byobu}/.welcome-displayed | 0 {byobu => dotfiles/byobu}/backend | 0 {byobu => dotfiles/byobu}/color | 0 {byobu => dotfiles/byobu}/color.tmux | 0 {byobu => dotfiles/byobu}/keybindings | 0 {byobu => dotfiles/byobu}/keybindings.tmux | 0 {byobu => dotfiles/byobu}/profile | 0 {byobu => dotfiles/byobu}/profile.tmux | 0 {byobu => dotfiles/byobu}/prompt | 0 {byobu => dotfiles/byobu}/status | 0 {byobu => dotfiles/byobu}/statusrc | 0 {byobu => dotfiles/byobu}/windows | 0 curlrc => dotfiles/curlrc | 0 gdbinit => dotfiles/gdbinit | 0 gitconfig => dotfiles/gitconfig | 0 gitignore => dotfiles/gitignore | 0 {gnupg => dotfiles/gnupg}/gpg-agent.conf | 0 {gnupg => dotfiles/gnupg}/gpg.conf | 0 {gnupg => dotfiles/gnupg}/sks-keyservers.pem | 0 {irssi => dotfiles/irssi}/config | 0 {irssi => dotfiles/irssi}/default.theme | 0 {irssi => dotfiles/irssi}/instantssl.crt | 0 .../irssi}/scripts/adv_windowlist.pl | 0 .../irssi}/scripts/autorun/adv_windowlist.pl | 0 .../irssi}/scripts/autorun/cap_sasl.pl | 0 {irssi => dotfiles/irssi}/scripts/cap_sasl.pl | 0 profile => dotfiles/profile | 0 {radare2 => dotfiles/radare2}/xdot | 0 radare2rc => dotfiles/radare2rc | 0 reverser-gdbinit => dotfiles/reverser-gdbinit | 0 {ssh => dotfiles/ssh}/config | 0 {ssh => dotfiles/ssh}/master/.keep | 0 tmux.conf => dotfiles/tmux.conf | 0 .../tmux}/tmux-solarized-256.conf | 0 {vim => dotfiles/vim}/ftplugin/python.vim | 0 vimrc => dotfiles/vimrc | 0 wgetrc => dotfiles/wgetrc | 0 xprofile => dotfiles/xprofile | 0 .../zsh_custom}/plugins/virsh/_virsh | 0 .../zsh_custom}/themes/matir.zsh-theme | 0 zshenv => dotfiles/zshenv | 0 zshrc => dotfiles/zshrc | 0 .../zshrc.d}/remove-wine-files | 0 {zshrc.d => dotfiles/zshrc.d}/ssh-completion | 0 install.sh | 21 +++++++++++++++---- 49 files changed, 17 insertions(+), 4 deletions(-) rename ackrc => dotfiles/ackrc (100%) rename aliases => dotfiles/aliases (100%) rename bashrc => dotfiles/bashrc (100%) rename {byobu => dotfiles/byobu}/.tmux.conf (100%) rename {byobu => dotfiles/byobu}/.welcome-displayed (100%) rename {byobu => dotfiles/byobu}/backend (100%) rename {byobu => dotfiles/byobu}/color (100%) rename {byobu => dotfiles/byobu}/color.tmux (100%) rename {byobu => dotfiles/byobu}/keybindings (100%) rename {byobu => dotfiles/byobu}/keybindings.tmux (100%) rename {byobu => dotfiles/byobu}/profile (100%) rename {byobu => dotfiles/byobu}/profile.tmux (100%) rename {byobu => dotfiles/byobu}/prompt (100%) rename {byobu => dotfiles/byobu}/status (100%) rename {byobu => dotfiles/byobu}/statusrc (100%) rename {byobu => dotfiles/byobu}/windows (100%) rename curlrc => dotfiles/curlrc (100%) rename gdbinit => dotfiles/gdbinit (100%) rename gitconfig => dotfiles/gitconfig (100%) rename gitignore => dotfiles/gitignore (100%) rename {gnupg => dotfiles/gnupg}/gpg-agent.conf (100%) rename {gnupg => dotfiles/gnupg}/gpg.conf (100%) rename {gnupg => dotfiles/gnupg}/sks-keyservers.pem (100%) rename {irssi => dotfiles/irssi}/config (100%) rename {irssi => dotfiles/irssi}/default.theme (100%) rename {irssi => dotfiles/irssi}/instantssl.crt (100%) rename {irssi => dotfiles/irssi}/scripts/adv_windowlist.pl (100%) rename {irssi => dotfiles/irssi}/scripts/autorun/adv_windowlist.pl (100%) rename {irssi => dotfiles/irssi}/scripts/autorun/cap_sasl.pl (100%) rename {irssi => dotfiles/irssi}/scripts/cap_sasl.pl (100%) rename profile => dotfiles/profile (100%) rename {radare2 => dotfiles/radare2}/xdot (100%) rename radare2rc => dotfiles/radare2rc (100%) rename reverser-gdbinit => dotfiles/reverser-gdbinit (100%) rename {ssh => dotfiles/ssh}/config (100%) rename {ssh => dotfiles/ssh}/master/.keep (100%) rename tmux.conf => dotfiles/tmux.conf (100%) rename {tmux => dotfiles/tmux}/tmux-solarized-256.conf (100%) rename {vim => dotfiles/vim}/ftplugin/python.vim (100%) rename vimrc => dotfiles/vimrc (100%) rename wgetrc => dotfiles/wgetrc (100%) rename xprofile => dotfiles/xprofile (100%) rename {zsh_custom => dotfiles/zsh_custom}/plugins/virsh/_virsh (100%) rename {zsh_custom => dotfiles/zsh_custom}/themes/matir.zsh-theme (100%) rename zshenv => dotfiles/zshenv (100%) rename zshrc => dotfiles/zshrc (100%) rename {zshrc.d => dotfiles/zshrc.d}/remove-wine-files (100%) rename {zshrc.d => dotfiles/zshrc.d}/ssh-completion (100%) diff --git a/ackrc b/dotfiles/ackrc similarity index 100% rename from ackrc rename to dotfiles/ackrc diff --git a/aliases b/dotfiles/aliases similarity index 100% rename from aliases rename to dotfiles/aliases diff --git a/bashrc b/dotfiles/bashrc similarity index 100% rename from bashrc rename to dotfiles/bashrc diff --git a/byobu/.tmux.conf b/dotfiles/byobu/.tmux.conf similarity index 100% rename from byobu/.tmux.conf rename to dotfiles/byobu/.tmux.conf diff --git a/byobu/.welcome-displayed b/dotfiles/byobu/.welcome-displayed similarity index 100% rename from byobu/.welcome-displayed rename to dotfiles/byobu/.welcome-displayed diff --git a/byobu/backend b/dotfiles/byobu/backend similarity index 100% rename from byobu/backend rename to dotfiles/byobu/backend diff --git a/byobu/color b/dotfiles/byobu/color similarity index 100% rename from byobu/color rename to dotfiles/byobu/color diff --git a/byobu/color.tmux b/dotfiles/byobu/color.tmux similarity index 100% rename from byobu/color.tmux rename to dotfiles/byobu/color.tmux diff --git a/byobu/keybindings b/dotfiles/byobu/keybindings similarity index 100% rename from byobu/keybindings rename to dotfiles/byobu/keybindings diff --git a/byobu/keybindings.tmux b/dotfiles/byobu/keybindings.tmux similarity index 100% rename from byobu/keybindings.tmux rename to dotfiles/byobu/keybindings.tmux diff --git a/byobu/profile b/dotfiles/byobu/profile similarity index 100% rename from byobu/profile rename to dotfiles/byobu/profile diff --git a/byobu/profile.tmux b/dotfiles/byobu/profile.tmux similarity index 100% rename from byobu/profile.tmux rename to dotfiles/byobu/profile.tmux diff --git a/byobu/prompt b/dotfiles/byobu/prompt similarity index 100% rename from byobu/prompt rename to dotfiles/byobu/prompt diff --git a/byobu/status b/dotfiles/byobu/status similarity index 100% rename from byobu/status rename to dotfiles/byobu/status diff --git a/byobu/statusrc b/dotfiles/byobu/statusrc similarity index 100% rename from byobu/statusrc rename to dotfiles/byobu/statusrc diff --git a/byobu/windows b/dotfiles/byobu/windows similarity index 100% rename from byobu/windows rename to dotfiles/byobu/windows diff --git a/curlrc b/dotfiles/curlrc similarity index 100% rename from curlrc rename to dotfiles/curlrc diff --git a/gdbinit b/dotfiles/gdbinit similarity index 100% rename from gdbinit rename to dotfiles/gdbinit diff --git a/gitconfig b/dotfiles/gitconfig similarity index 100% rename from gitconfig rename to dotfiles/gitconfig diff --git a/gitignore b/dotfiles/gitignore similarity index 100% rename from gitignore rename to dotfiles/gitignore diff --git a/gnupg/gpg-agent.conf b/dotfiles/gnupg/gpg-agent.conf similarity index 100% rename from gnupg/gpg-agent.conf rename to dotfiles/gnupg/gpg-agent.conf diff --git a/gnupg/gpg.conf b/dotfiles/gnupg/gpg.conf similarity index 100% rename from gnupg/gpg.conf rename to dotfiles/gnupg/gpg.conf diff --git a/gnupg/sks-keyservers.pem b/dotfiles/gnupg/sks-keyservers.pem similarity index 100% rename from gnupg/sks-keyservers.pem rename to dotfiles/gnupg/sks-keyservers.pem diff --git a/irssi/config b/dotfiles/irssi/config similarity index 100% rename from irssi/config rename to dotfiles/irssi/config diff --git a/irssi/default.theme b/dotfiles/irssi/default.theme similarity index 100% rename from irssi/default.theme rename to dotfiles/irssi/default.theme diff --git a/irssi/instantssl.crt b/dotfiles/irssi/instantssl.crt similarity index 100% rename from irssi/instantssl.crt rename to dotfiles/irssi/instantssl.crt diff --git a/irssi/scripts/adv_windowlist.pl b/dotfiles/irssi/scripts/adv_windowlist.pl similarity index 100% rename from irssi/scripts/adv_windowlist.pl rename to dotfiles/irssi/scripts/adv_windowlist.pl diff --git a/irssi/scripts/autorun/adv_windowlist.pl b/dotfiles/irssi/scripts/autorun/adv_windowlist.pl similarity index 100% rename from irssi/scripts/autorun/adv_windowlist.pl rename to dotfiles/irssi/scripts/autorun/adv_windowlist.pl diff --git a/irssi/scripts/autorun/cap_sasl.pl b/dotfiles/irssi/scripts/autorun/cap_sasl.pl similarity index 100% rename from irssi/scripts/autorun/cap_sasl.pl rename to dotfiles/irssi/scripts/autorun/cap_sasl.pl diff --git a/irssi/scripts/cap_sasl.pl b/dotfiles/irssi/scripts/cap_sasl.pl similarity index 100% rename from irssi/scripts/cap_sasl.pl rename to dotfiles/irssi/scripts/cap_sasl.pl diff --git a/profile b/dotfiles/profile similarity index 100% rename from profile rename to dotfiles/profile diff --git a/radare2/xdot b/dotfiles/radare2/xdot similarity index 100% rename from radare2/xdot rename to dotfiles/radare2/xdot diff --git a/radare2rc b/dotfiles/radare2rc similarity index 100% rename from radare2rc rename to dotfiles/radare2rc diff --git a/reverser-gdbinit b/dotfiles/reverser-gdbinit similarity index 100% rename from reverser-gdbinit rename to dotfiles/reverser-gdbinit diff --git a/ssh/config b/dotfiles/ssh/config similarity index 100% rename from ssh/config rename to dotfiles/ssh/config diff --git a/ssh/master/.keep b/dotfiles/ssh/master/.keep similarity index 100% rename from ssh/master/.keep rename to dotfiles/ssh/master/.keep diff --git a/tmux.conf b/dotfiles/tmux.conf similarity index 100% rename from tmux.conf rename to dotfiles/tmux.conf diff --git a/tmux/tmux-solarized-256.conf b/dotfiles/tmux/tmux-solarized-256.conf similarity index 100% rename from tmux/tmux-solarized-256.conf rename to dotfiles/tmux/tmux-solarized-256.conf diff --git a/vim/ftplugin/python.vim b/dotfiles/vim/ftplugin/python.vim similarity index 100% rename from vim/ftplugin/python.vim rename to dotfiles/vim/ftplugin/python.vim diff --git a/vimrc b/dotfiles/vimrc similarity index 100% rename from vimrc rename to dotfiles/vimrc diff --git a/wgetrc b/dotfiles/wgetrc similarity index 100% rename from wgetrc rename to dotfiles/wgetrc diff --git a/xprofile b/dotfiles/xprofile similarity index 100% rename from xprofile rename to dotfiles/xprofile diff --git a/zsh_custom/plugins/virsh/_virsh b/dotfiles/zsh_custom/plugins/virsh/_virsh similarity index 100% rename from zsh_custom/plugins/virsh/_virsh rename to dotfiles/zsh_custom/plugins/virsh/_virsh diff --git a/zsh_custom/themes/matir.zsh-theme b/dotfiles/zsh_custom/themes/matir.zsh-theme similarity index 100% rename from zsh_custom/themes/matir.zsh-theme rename to dotfiles/zsh_custom/themes/matir.zsh-theme diff --git a/zshenv b/dotfiles/zshenv similarity index 100% rename from zshenv rename to dotfiles/zshenv diff --git a/zshrc b/dotfiles/zshrc similarity index 100% rename from zshrc rename to dotfiles/zshrc diff --git a/zshrc.d/remove-wine-files b/dotfiles/zshrc.d/remove-wine-files similarity index 100% rename from zshrc.d/remove-wine-files rename to dotfiles/zshrc.d/remove-wine-files diff --git a/zshrc.d/ssh-completion b/dotfiles/zshrc.d/ssh-completion similarity index 100% rename from zshrc.d/ssh-completion rename to dotfiles/zshrc.d/ssh-completion diff --git a/install.sh b/install.sh index cfcb310..76fe91b 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ set nounset set errexit -BASEDIR=${BASEDIR:-$HOME/.dotfiles} +BASEDIR=${BASEDIR:-$HOME/.skel} if [ ! -d $BASEDIR ] ; then echo "Please install to $BASEDIR!" 1>&2 @@ -36,7 +36,7 @@ function prerequisites { fi } -function install_dir { +function install_dotfile_dir { SRCDIR="${1}" find "${SRCDIR}" \( -name .git -o \ -path "${SRCDIR}/private_dotfiles" -o \ @@ -50,6 +50,17 @@ function install_dir { done } +function install_basic_dir { + SRCDIR="${1}" + DESTDIR="${2}" + find "${SRCDIR}" -type f -print | \ + while read file ; do + TARGET="${2}/.${file#${SRCDIR}/}" + mkdir -p `dirname "${TARGET}"` + ln -s -f "${file}" "${TARGET}" + done +} + function postinstall { # Install Vundle plugins if [ -d $HOME/.vim/bundle/Vundle.vim ] ; then @@ -58,6 +69,8 @@ function postinstall { } prerequisites -install_dir "${BASEDIR}" -test -d "${BASEDIR}/private_dotfiles" && install_dir "${BASEDIR}/private_dotfiles" +install_dotfile_dir "${BASEDIR}/.dotfiles" +test -d "${BASEDIR}/private_dotfiles" && \ + install_dotfile_dir "${BASEDIR}/private_dotfiles" +install_basic_dir "${BASEDIR}/bin" "${HOME}/bin" postinstall