Merge branch 'master' of ssh://2px.info.tm/~/repos/SetupCockpit

This commit is contained in:
flyingscorpio@arch-desktop 2020-04-12 19:57:12 +02:00
commit 35b399bd0e

View file

@ -79,24 +79,26 @@ export OS
OVERWRITE='false'
UPDATE='false'
case "$1" in
-o | --overwrite )
echo "${ORANGE}You agree to overwrite preexisting files!${NC}"
OVERWRITE='true'
;;
-u | --update )
echo "${ORANGE}Set to update plugins!${NC}"
UPDATE='true'
;;
-ou | -uo )
echo "${ORANGE}Both options were set.${NC}"
OVERWRITE='true'
UPDATE='true'
;;
* )
echo "Din't understand arguments"
exit 1
esac
if [ "$#" -ge 1 ]; then
case "$1" in
-o | --overwrite )
echo "${ORANGE}You agree to overwrite preexisting files!${NC}"
OVERWRITE='true'
;;
-u | --update )
echo "${ORANGE}Set to update plugins!${NC}"
UPDATE='true'
;;
-ou | -uo )
echo "${ORANGE}Both options were set.${NC}"
OVERWRITE='true'
UPDATE='true'
;;
* )
echo "Din't understand arguments"
exit 1
esac
fi
if [ "$#" -eq 2 ]; then
case "$2" in
-o | --overwrite )
@ -164,7 +166,7 @@ update_i3() { # {{{
separator
} # }}}
update_i3
# update_i3
configure_protonvpn() { # {{{
# Configure ProtonVPN
@ -180,16 +182,32 @@ setup_bash_files() { # {{{
# Set up .bashrc
echo "Updating .bashrc..."
if [ ! -L ~/.bashrc ]; then
ln -rs "$BASE_DIR"/dotfiles/bash/bashrc ~/.bashrc 2> /dev/null
if [ ~/.bashrc -ef "$BASE_DIR"/dotfiles/bash/bashrc ]; then
echo "${GREEN}.bashrc points to the right location."
echo "Nothing changed.${NC}"
else
if [ "$OVERWRITE" = 'true' ]; then
rm ~/.bashrc 2> /dev/null
fi
if ln -rs "$BASE_DIR"/dotfiles/bash/bashrc ~/.bashrc; then
echo "${ORANGE}.bashrc symlink created${NC}"
fi
fi
separator
# Set up .bash_aliases
echo "Updating .bash_aliases..."
if [ ! -L ~/.bash_aliases ]; then
ln -rs "$BASE_DIR"/dotfiles/bash/bash_aliases ~/.bash_aliases 2> /dev/null
if [ ~/.bash_aliases -ef "$BASE_DIR"/dotfiles/bash/bash_aliases ]; then
echo "${GREEN}.bash_aliases points to the right location."
echo "Nothing changed.${NC}"
else
if [ "$OVERWRITE" = 'true' ]; then
rm ~/.bash_aliases 2> /dev/null
fi
if ln -rs "$BASE_DIR"/dotfiles/bash/bash_aliases ~/.bash_aliases; then
echo "${ORANGE}.bash_aliases symlink created${NC}"
fi
fi
separator