setup-cockpit/SetupCockpit/setup_cockpit.sh

106 lines
2.7 KiB
Bash
Executable file

#!/bin/bash
## Script to automate the setting up of my working environment.
#############
# DEFINE OS #
#############
if [ -z "$1" ]; then
echo "Which OS are you using?"
select os in 'debian - ubuntu' 'arch - manjaro'; do
case $os in
'debian - ubuntu' ) os='debian'; break;;
'arch - manjaro' ) os='arch'; break;;
esac
done
else
if [ "$1" = 'debian' ] || [ "$1" = 'ubuntu' ]; then
os='debian'
elif [ "$1" = 'arch' ] || [ "$1" = 'manjaro' ]; then
os='arch'
else
echo "${ORANGE}Didn't understand OS argument${NC}"
echo "Which OS are you using?"
select os in 'debian - ubuntu' 'arch - manjaro'; do
case $os in
'debian - ubuntu' ) os='debian'; break;;
'arch - manjaro' ) os='arch'; break;;
esac
done
fi
fi
echo "Using $os"
export os
/bin/bash separator.sh
###################
# Install scripts #
###################
if [ "$os" = 'debian' ]; then
/bin/bash debian_based_installs.sh
elif [ "$os" = 'arch' ]; then
/bin/bash arch_based_installs.sh
else
echo "${RED} Didn't receive correct OS information, quitting...${NC}"
fi
/bin/bash separator.sh
####################
# Set bash aliases #
####################
echo "Writing aliases to ~/.bash_aliases..."
echo "alias lime2connect='ssh flyingscorpio@2px.info.tm'
alias protonvpn='sudo protonvpn'
alias fish='fish ~/.config/fish/functions/my_aliases.fish && fish'
alias rm='rm --preserve-root'
alias ll='ls -lArth'
alias la='ls -A'
alias l='ls -CF'
alias tor-browser-start='~/tor-browser_en-US/tor-browser_en-US/Browser/start-tor-browser --detach'" >> ~/.bash_aliases
/bin/bash separator.sh
#################
# Configure Git #
#################
echo "Configuring Git..."
git config --global user.name "$USER@$(uname -n)"
git config --global user.email "tfranken@protonmail.com"
git config --global alias.ci "commit"
git config --global alias.co "checkout"
git config --global alias.st "status"
git config --global alias.br "branch"
/bin/bash separator.sh
##############################################################################
# Add MIME type for reading .md files in Firefox (need to add extension too) #
##############################################################################
echo "Adding MIME type for .md files in Firefox"
echo "${ORANGE}Remember to install the Firefox extension for it to work${NC}"
if [ -e ~/.local/share/mime/packages/text-markdown.xml ]; then
echo "<?xml version=\"1.0\"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type=\"text/plain\">
<glob pattern=\"*.md\"/>
<glob pattern=\"*.mkd\"/>
<glob pattern=\"*.markdown\"/>
</mime-type>
</mime-info>" >> ~/.local/share/mime/packages/text-markdown.xml
fi
/bin/bash separator.sh