138 lines
2.8 KiB
Bash
Executable file
138 lines
2.8 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
## Script to automate the setting up of my working environment.
|
|
|
|
|
|
RED=$(tput setaf 1)
|
|
GREEN=$(tput setaf 2)
|
|
ORANGE=$(tput setaf 3)
|
|
NC=$(tput sgr0)
|
|
|
|
export RED
|
|
export GREEN
|
|
export ORANGE
|
|
export NC
|
|
|
|
|
|
# Define OS {{{
|
|
|
|
OS='none'
|
|
os_release=$(cat /etc/os-release*)
|
|
case ${os_release,,} in
|
|
*debian* )
|
|
OS='debian'
|
|
echo "You are using Debian"
|
|
;;
|
|
*ubuntu* )
|
|
OS='debian'
|
|
echo "You are using Ubuntu"
|
|
;;
|
|
*arch* )
|
|
OS='arch'
|
|
echo "You are using Arch-Linux"
|
|
;;
|
|
*manjaro* )
|
|
OS='arch'
|
|
echo "You are using Manjaro"
|
|
;;
|
|
* )
|
|
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
|
|
echo "Using $OS"
|
|
esac
|
|
export OS
|
|
|
|
/bin/bash ~/SetupCockpit/separator.sh
|
|
|
|
# }}}
|
|
|
|
# Install scripts {{{
|
|
|
|
echo "Installing scripts..."
|
|
|
|
if [ "$OS" = 'debian' ]; then
|
|
/bin/bash ~/SetupCockpit/debian_based_installs.sh
|
|
elif [ "$OS" = 'arch' ]; then
|
|
/bin/bash ~/SetupCockpit/arch_based_installs.sh
|
|
else
|
|
echo "${RED} Didn't receive correct OS information, quitting...${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
/bin/bash ~/SetupCockpit/separator.sh
|
|
|
|
# }}}
|
|
|
|
# Update .bash_aliases {{{
|
|
|
|
echo "Updating .bash_aliases..."
|
|
if cp ~/SetupCockpit/bash_aliases ~/.bash_aliases; then
|
|
echo "${GREEN}Successfully updated .bash_aliases${NC}"
|
|
else
|
|
echo "${ORANGE}There was a problem while updating .bash_aliases${NC}"
|
|
fi
|
|
|
|
/bin/bash ~/SetupCockpit/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 ~/SetupCockpit/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 ~/SetupCockpit/separator.sh
|
|
|
|
# }}}
|
|
|
|
# Clone projects {{{
|
|
|
|
echo "Cloning projects..."
|
|
|
|
/bin/bash clone_projects.sh
|
|
|
|
/bin/bash ~/SetupCockpit/separator.sh
|
|
|
|
# }}}
|
|
|
|
# Configure ProtonVPN {{{
|
|
|
|
echo "Configuring ProtonVPN..."
|
|
|
|
sudo protonvpn init && sudo protonvpn c --cc NL
|
|
|
|
/bin/bash ~/SetupCockpit/separator.sh
|
|
|
|
# }}}
|