From 623b8e09f00704cb953f1b718ff9675eaffa7989 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 23 Feb 2020 12:22:09 +0100 Subject: submodule upgrade --- .vim/bundle/nerdtree | 2 +- .vim/bundle/nerdtree-git-plugin | 2 +- .vim/bundle/vim-airline | 2 +- .vim/bundle/vim-airline-themes | 2 +- .vim/bundle/vim-signify | 2 +- .vim/bundle/vimagit | 2 +- bash-it | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree index 2d639b7..e67324f 160000 --- a/.vim/bundle/nerdtree +++ b/.vim/bundle/nerdtree @@ -1 +1 @@ -Subproject commit 2d639b70e73ecf3f62884a578fe5e5937e6d8a92 +Subproject commit e67324fdea7a192c7ce1b4c6b3c3b9f82f11eee7 diff --git a/.vim/bundle/nerdtree-git-plugin b/.vim/bundle/nerdtree-git-plugin index 0501cdf..f522a09 160000 --- a/.vim/bundle/nerdtree-git-plugin +++ b/.vim/bundle/nerdtree-git-plugin @@ -1 +1 @@ -Subproject commit 0501cdfbe3064d1f2d0987929565bccee5f5a6a5 +Subproject commit f522a091e2838812d2669c331d7e9c283db6d54d diff --git a/.vim/bundle/vim-airline b/.vim/bundle/vim-airline index 62f2dc0..0b26834 160000 --- a/.vim/bundle/vim-airline +++ b/.vim/bundle/vim-airline @@ -1 +1 @@ -Subproject commit 62f2dc02f01da7cfa16e45a9f8ce7036a03c3420 +Subproject commit 0b2683464877c1e39d0c67427c7fdc4bc6697d15 diff --git a/.vim/bundle/vim-airline-themes b/.vim/bundle/vim-airline-themes index 0d5c5c1..9772475 160000 --- a/.vim/bundle/vim-airline-themes +++ b/.vim/bundle/vim-airline-themes @@ -1 +1 @@ -Subproject commit 0d5c5c1e2995126e76606a628316c8e3f5efb37a +Subproject commit 9772475fcc24bee50c884aba20161465211520c8 diff --git a/.vim/bundle/vim-signify b/.vim/bundle/vim-signify index 13ba32a..56db16f 160000 --- a/.vim/bundle/vim-signify +++ b/.vim/bundle/vim-signify @@ -1 +1 @@ -Subproject commit 13ba32ae556b1d6e4e354f5647f6f1ab91d10e55 +Subproject commit 56db16f8d3825c4d066c2faf05315c2b208cd5f5 diff --git a/.vim/bundle/vimagit b/.vim/bundle/vimagit index 94762b1..bf7b16e 160000 --- a/.vim/bundle/vimagit +++ b/.vim/bundle/vimagit @@ -1 +1 @@ -Subproject commit 94762b1356ebdcb8ec486a86f45e69ef77a69465 +Subproject commit bf7b16e99e075b019e56f2fbfb96c493ca3635e2 diff --git a/bash-it b/bash-it index 6c64ba2..bf5dd87 160000 --- a/bash-it +++ b/bash-it @@ -1 +1 @@ -Subproject commit 6c64ba26f13e909f31fde5ee871a1d4d1a950925 +Subproject commit bf5dd87f337dac0ca5346d53733850b3e21055d1 -- cgit v1.2.3 From f1ae7aec9fd82b10abf17a19de69982f6c2f66da Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 23 Feb 2020 12:26:29 +0100 Subject: dynamic path generation --- .bash_profile | 1 + .bashrc | 13 ++++++-- install.sh | 95 ++++++++++++++++++++++++++++++++++++++++++++++------------- 3 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/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 + -- cgit v1.2.3