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 15cac42..0d63296 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 \ @@ -51,6 +51,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 @@ -59,6 +70,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