aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bash_profile1
-rw-r--r--.bashrc13
m---------.vim/bundle/nerdtree0
m---------.vim/bundle/nerdtree-git-plugin0
m---------.vim/bundle/vim-airline0
m---------.vim/bundle/vim-airline-themes0
m---------.vim/bundle/vim-signify0
m---------.vim/bundle/vimagit0
m---------bash-it0
-rwxr-xr-xinstall.sh95
10 files changed, 85 insertions, 24 deletions
diff --git a/.bash_profile b/.bash_profile
index 038dfd2..5f73e6a 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -8,5 +8,6 @@ export EDITOR=nvim
export VISUAL=nvim
PATH=~/bin:$PATH
+[[ -f ~/.files ]] && source ~/.files && PATH="$DOTFILEBASE/scripts:$PATH"
[[ -f ~/.bashrc ]] && . ~/.bashrc
diff --git a/.bashrc b/.bashrc
index 109fe0a..119272d 100644
--- a/.bashrc
+++ b/.bashrc
@@ -6,15 +6,22 @@ case $- in
*) return;;
esac
-export BASH_IT_CUSTOM="/home/jonas/vimconfig"
+if [ -e ".files" ]
+then
+ source .files
+else
+ DOTFILEBASE="/home/jonas/vimconfig"
+fi
+
+export BASH_IT_CUSTOM=$DOTFILEBASE
# Path to the bash it configuration
-export BASH_IT="/home/jonas/vimconfig/bash-it"
+export BASH_IT="$DOTFILEBASE/bash-it"
# Lock and Load a custom theme file.
# Leave empty to disable theming.
# location /.bash_it/themes/
-export BASH_IT_THEME='/home/jonas/vimconfig/theme.bash'
+export BASH_IT_THEME="$DOTFILEBASE/theme.bash"
# (Advanced): Change this to the name of your remote repo if you
# cloned bash-it with a remote other than origin such as `bash-it`.
diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree
-Subproject 2d639b70e73ecf3f62884a578fe5e5937e6d8a9
+Subproject e67324fdea7a192c7ce1b4c6b3c3b9f82f11eee
diff --git a/.vim/bundle/nerdtree-git-plugin b/.vim/bundle/nerdtree-git-plugin
-Subproject 0501cdfbe3064d1f2d0987929565bccee5f5a6a
+Subproject f522a091e2838812d2669c331d7e9c283db6d54
diff --git a/.vim/bundle/vim-airline b/.vim/bundle/vim-airline
-Subproject 62f2dc02f01da7cfa16e45a9f8ce7036a03c342
+Subproject 0b2683464877c1e39d0c67427c7fdc4bc6697d1
diff --git a/.vim/bundle/vim-airline-themes b/.vim/bundle/vim-airline-themes
-Subproject 0d5c5c1e2995126e76606a628316c8e3f5efb37
+Subproject 9772475fcc24bee50c884aba20161465211520c
diff --git a/.vim/bundle/vim-signify b/.vim/bundle/vim-signify
-Subproject 13ba32ae556b1d6e4e354f5647f6f1ab91d10e5
+Subproject 56db16f8d3825c4d066c2faf05315c2b208cd5f
diff --git a/.vim/bundle/vimagit b/.vim/bundle/vimagit
-Subproject 94762b1356ebdcb8ec486a86f45e69ef77a6946
+Subproject bf7b16e99e075b019e56f2fbfb96c493ca3635e
diff --git a/bash-it b/bash-it
-Subproject 6c64ba26f13e909f31fde5ee871a1d4d1a95092
+Subproject bf5dd87f337dac0ca5346d53733850b3e21055d
diff --git a/install.sh b/install.sh
index 3791729..109e7c5 100755
--- a/install.sh
+++ b/install.sh
@@ -1,14 +1,10 @@
#!/bin/bash
-# Programs:
-# compton: Compositor
-# xterm fo default terminal
-
#Configs for home dir
-MODULES=(.i3 .vim .xinitrc .compton.conf .bashrc .Xresources .radare2rc .bash_profile)
+CFGS=(.i3 .vim .xinitrc .compton.conf .bashrc .Xresources .radare2rc .bash_profile)
#Configs for .config
-CFGFOLDER=(polybar powerline nvim termite twmn)
+CFGFOLDER=(polybar powerline nvim termite twmn fish)
#Scripts
SCRIPTS=()
@@ -18,18 +14,39 @@ yes_no()
{
read -p "$1 (y/[n])" inp
case $inp in
- [yY]* ) return 1;;
- * ) return 0;;
+ [yY]* ) return 0;;
+ * ) return 1;;
esac
}
+selector()
+{
+ local cnt=0
+ for i in "$@"
+ do
+ echo "$cnt) $i"
+ ((cnt=$cnt + 1))
+ done
+
+ read -p "(default=0) >" inp
+ if [[ "$inp" =~ ^-?[0-9]+\$ ]] && [ $inp -ge 0 -a $inp -le $# ]
+ then
+ return $inp
+ elif [ -z $inp ]
+ then
+ return 0
+ else
+ return -1
+ fi
+
+}
+
#1: source 2: destination
link()
{
if [ -e $2 ]
then
- yes_no "$(basename $2) exists. Overwrite?"
- if [ $? -eq 0 ]
+ if yes_no "$(basename $2) exists. Overwrite?"
then
return
fi
@@ -45,26 +62,62 @@ link()
ln -s "$1" "$2"
}
-echo Configs to install: ${MODULES[@]} ${CFGFOLDER[@]}
+
+if [ $# -gt 0 ]
+then
+ for i in "$@"
+ do
+ echo "Install $i to"
+ if [ -e $i ]
+ then
+ selector "~" "~/.config" "Custom location" "Abort"
+ case $? in
+ 0)
+ echo "~"
+ break;;
+ 1)
+ echo .config
+ break;;
+ 2)
+ echo custom
+ break;;
+ *)
+ echo Abort.
+ break;;
+ esac
+ else
+ echo $i does not exist. Skipping.
+ fi
+
+ done
+ exit 0
+fi
+
+WORKDIR=$(dirname $0)
+cd $WORKDIR
+echo Working in $WORKDIR
+echo Homedir is $HOME
+echo Available: ${CFGS[@]} ${CFGFOLDER[@]}
git submodule init
git submodule update
-for mod in ${MODULES[@]}; do
- yes_no "Install $mod?"
- #ln -s --backup $(pwd)/$mod/ ~/$mod/
- if [ $? -eq 1 ]
+for mod in "${CFGS[@]}"; do
+ if yes_no "Install $mod?"
then
- link "$(pwd)/$(dirname $0)/$mod" "$HOME/$mod"
+ link "$(pwd)/$mod" "$HOME/$mod"
fi
done
-for mod in ${CFGFOLDER[@]}; do
- #ln -s --backup $(pwd)/$mod/ ~/.config/$mod/
- yes_no "Install $mod?"
- if [ $? -eq 1 ]
+for mod in "${CFGFOLDER[@]}"; do
+ if yes_no "Install $mod?"
then
- link "$(pwd)/$(dirname $0)/$mod" "$HOME/.config/$mod"
+ link "$(pwd)/$mod" "$HOME/.config/$mod"
fi
done
+#.files is used to tell scripts where to look for the dotfiles
+if yes_no "Generate '.files'?"; then
+ echo "DOTFILEBASE=\"$(pwd)\"" > $HOME/.files
+fi
+