better ~/bin install

This commit is contained in:
David Todd 2021-01-11 21:41:00 -06:00
parent 351b67de1e
commit 56671a8b7f

View File

@ -9,7 +9,7 @@ repourl="git://github.com/alopexc0de/dotfiles.git"
# Exit the script if any errors are encountered # Exit the script if any errors are encountered
#set -e #set -e
basedir=$HOME/dotfiles DOT_DIR=$HOME/dotfiles
bindir=$HOME/bin bindir=$HOME/bin
postinst=$HOME/.dotfiles.postinst postinst=$HOME/.dotfiles.postinst
@ -45,46 +45,46 @@ if ! which git >>/dev/null ; then
fi fi
# If the update script exists, try to do a normal update # If the update script exists, try to do a normal update
if [ -x "$basedir/internal_bin/check_for_upgrade.sh" ]; then if [ -x "$DOT_DIR/internal_bin/check_for_upgrade.sh" ]; then
source "$basedir/shell/env" source "$DOT_DIR/shell/env"
env _DOTFILES=$basedir DISABLE_UPDATE_PROMPT='FALSE' zsh -f $basedir/internal_bin/check_for_upgrade.sh env _DOTFILES=$DOT_DIR DISABLE_UPDATE_PROMPT='FALSE' zsh -f $DOT_DIR/internal_bin/check_for_upgrade.sh
else else
echo "Cloning dotfiles to $basedir" echo "Cloning dotfiles to $DOT_DIR"
rm -rf $basedir rm -rf "${DOT_DIR}"
git clone --depth=1 $repourl $basedir git clone --depth=1 $repourl $DOT_DIR
fi fi
# Start installing config # Start installing config
echo "Linking config and local files" echo "Linking config and local files"
# Environment # Environment
symlink $basedir/home/.local $HOME/.local symlink $DOT_DIR/home/.local $HOME/.local
symlink $basedir/home/.config $HOME/.config symlink $DOT_DIR/home/.config $HOME/.config
echo "Installing Oh-My-ZSH" echo "Installing Oh-My-ZSH"
echo "When the install is done, type \"exit\" to continue installing dotfiles" echo "When the install is done, type \"exit\" to continue installing dotfiles"
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "Building i3 configuration" echo "Building i3 configuration"
$basedir/bin/build-i3-config $DOT_DIR/bin/build-i3-config
echo "Linking X-Session files" echo "Linking X-Session files"
# Stuff related to the X-Session # Stuff related to the X-Session
symlink $basedir/home/.config/compton.conf $HOME/.compton.conf symlink $DOT_DIR/home/.config/compton.conf $HOME/.compton.conf
symlink $basedir/home/Xresources $HOME/.Xresources symlink $DOT_DIR/home/Xresources $HOME/.Xresources
symlink $basedir/home/xinitrc $HOME/.xinitrc symlink $DOT_DIR/home/xinitrc $HOME/.xinitrc
echo "Linking shell files" echo "Linking shell files"
# Shell stuff # Shell stuff
symlink $basedir/home/shell/tmux.conf $HOME/.tmux.conf symlink $DOT_DIR/home/shell/tmux.conf $HOME/.tmux.conf
symlink $basedir/home/shell/bashrc $HOME/.bashrc symlink $DOT_DIR/home/shell/bashrc $HOME/.bashrc
symlink $basedir/home/shell/zshrc $HOME/.zshrc symlink $DOT_DIR/home/shell/zshrc $HOME/.zshrc
symlink $basedir/home/shell/vimrc $HOME/.vimrc symlink $DOT_DIR/home/shell/vimrc $HOME/.vimrc
symlink $basedir/home/dmenurc $HOME/.dmenurc symlink $DOT_DIR/home/dmenurc $HOME/.dmenurc
symlink $basedir/home/dmrc $HOME/.dmrc symlink $DOT_DIR/home/dmrc $HOME/.dmrc
# Global git # Global git
symlink $basedir/home/gitconfig $HOME/.gitconfig symlink $DOT_DIR/home/gitconfig $HOME/.gitconfig
echo "Installing shell-history" echo "Installing shell-history"
python3 -m pip install shellhistory python3 -m pip install shellhistory
@ -104,10 +104,7 @@ unzip iceberg.zip
cp -r iceberg.vim/{autoload,colors} ~/.vim/ cp -r iceberg.vim/{autoload,colors} ~/.vim/
echo "Adding user bin..." echo "Adding user bin..."
mkdir -p $bindir symlink $DOT_DIR/bin $HOME/bin
for file_path in $basedir/bin/*; do
symlink $file_path $bindir/$(basename $file_path)
done
echo "Changing default shell to ZSH..." echo "Changing default shell to ZSH..."
chsh -s /usr/bin/zsh chsh -s /usr/bin/zsh
@ -120,7 +117,6 @@ else
fi fi
echo "Install done." echo "Install done."
echo "Check tmux, vim, and your shell to verify everything is correct" echo "Log out and back in again for everything to take effect."
echo "you may need to launch a new instance of your shell"
} # Ensures that the whole script is downloaded before execution } # Ensures that the whole script is downloaded before execution