Remove .old/ containing the original shell scripts that were converted to python
This commit is contained in:
parent
dbf4d8e849
commit
a5e94436ed
7 changed files with 0 additions and 960 deletions
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
## This script handles the installations for Arch-based systems.
|
||||
## It is run by main_install.sh
|
||||
|
||||
if [ "$OS" != 'arch' ]; then
|
||||
echo "${RED}The OS wasn't defined as Arch. Quitting...${NC}"
|
||||
exit 1
|
||||
else
|
||||
echo "${GREEN}Installing for Arch-based systems${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing Keepass..."
|
||||
if sudo pacman -S --needed keepass; then
|
||||
echo "${GREEN}Successfully installed Keepass${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install Keepass${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing ProtonVPN..."
|
||||
if sudo pacman -S --needed openvpn dialog python-pip python-setuptools && sudo pip install protonvpn-cli; then
|
||||
echo "${GREEN}Successfully installed ProtonVPN${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install ProtonVPN${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing Git..."
|
||||
if sudo pacman -S --needed git; then
|
||||
echo "${GREEN}Successfully installed Git${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install Git${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing Vim..."
|
||||
# I use gvim instead of vim because the clipboard is compiled in gvim
|
||||
if sudo pacman -S --needed gvim; then
|
||||
echo "${GREEN}Successfully installed Vim${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install Vim${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing miscellaneous things..."
|
||||
if sudo pacman -S --needed curl wget; then
|
||||
echo "${GREEN}Successfully installed curl and wget${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install curl and wget${NC}"
|
||||
fi
|
|
@ -1,148 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
## This script clones all the different repos.
|
||||
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
echo "BASE_DIR wasn't set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set_up_lime2_repo() {
|
||||
repo_name="$1"
|
||||
folder="$2"
|
||||
echo "Setting up $repo_name..."
|
||||
if [ -e ~/"$folder"/"$repo_name" ]; then
|
||||
echo "${GREEN}$repo_name is already there.${NC}"
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updating..."
|
||||
cd ~/"$folder"/"$repo_name" && git pull
|
||||
fi
|
||||
else
|
||||
echo "${ORANGE}Cloning new $repo_name...${NC}"
|
||||
cd ~/"$folder" && git clone ssh://flyingscorpio@2px.info.tm/~/repos/"$repo_name".git
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
set_up_gitlab_repo() {
|
||||
repo_owner="$1"
|
||||
repo_name="$2"
|
||||
folder="$3"
|
||||
echo "Setting up $repo_owner/$repo_name..."
|
||||
if [ -e ~/"$folder"/"$repo_name" ]; then
|
||||
echo "${GREEN}$repo_name is already there.${NC}"
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updating..."
|
||||
cd ~/"$folder"/"$repo_name" && git pull
|
||||
fi
|
||||
else
|
||||
echo "${ORANGE}Cloning new $repo_name...${NC}"
|
||||
cd ~/"$folder" && git clone https://gitlab.com/"$repo_owner"/"$repo_name".git
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# REPOS ON LIME2 {{{
|
||||
|
||||
echo "Setting up Lessons..."
|
||||
if [ ! -e ~/Lessons ]; then
|
||||
mkdir ~/Lessons && echo "${ORANGE}Created ~/Lessons${NC}"
|
||||
fi
|
||||
set_up_lime2_repo 'E2L' 'Lessons'
|
||||
set_up_lime2_repo 'OpenClassrooms' 'Lessons'
|
||||
set_up_lime2_repo 'Keepass'
|
||||
set_up_lime2_repo 'PersonnalScripts'
|
||||
set_up_lime2_repo 'RootMe'
|
||||
set_up_lime2_repo 'SetupCockpit'
|
||||
|
||||
# }}}
|
||||
|
||||
# REPOS ON GITLAB {{{
|
||||
|
||||
if [ ! -e ~/SRC ]; then
|
||||
mkdir ~/SRC && echo "${ORANGE}Created ~/SRC${NC}"
|
||||
fi
|
||||
|
||||
set_up_gitlab_repo 'e2li' 'depydoc' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'BlurMySearches' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'JsonToPython' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'MarioSokoban' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'PythonLocalBlockchain' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'Roboc-GUI' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'Roboc-console' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'ScheduleTimer' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'SudokuSolver' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'TicTacToe' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'TorNoVPN' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'WhitespaceInterpreter' 'SRC'
|
||||
set_up_gitlab_repo 'flyingscorpio' 'WikipediaAcronymScraper' 'SRC'
|
||||
|
||||
echo "Setting up 2px..."
|
||||
if [ -e ~/SRC/2px ]; then
|
||||
echo "${GREEN}2px is already there.${NC}"
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updating..."
|
||||
cd ~/SRC/2px && git pull
|
||||
fi
|
||||
else
|
||||
echo "${ORANGE}Cloning new 2px...${NC}"
|
||||
cd ~/SRC && git clone git@gitlab.com:flyingscorpio/2px.git
|
||||
cd ~/SRC/2px && python3 -m venv env
|
||||
echo "
|
||||
# Set own environment variables for Django
|
||||
DJANGO_USER='flyingscorpio'
|
||||
export DJANGO_USER
|
||||
DJANGO_PASSWORD='ribosome66'
|
||||
export DJANGO_PASSWORD
|
||||
DJANGO_SECRET_KEY='q+hci0d5y90q)k07f@1k3qzr&w=@89n(0z0ukp)_iu(g9iws0r'
|
||||
export DJANGO_SECRET_KEY
|
||||
systemctl start mysqld.service" >> ~/SRC/2px/env/bin/activate
|
||||
fi
|
||||
|
||||
echo "Setting up AD-website..."
|
||||
if [ -e ~/SRC/AD-website ]; then
|
||||
echo "${GREEN}AD-website is already there.${NC}"
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updating..."
|
||||
cd ~/SRC/AD-website && git pull
|
||||
fi
|
||||
else
|
||||
echo "${ORANGE}Cloning new AD-website...${NC}"
|
||||
cd ~/SRC && git clone git@gitlab.com:flyingscorpio/AD-website.git
|
||||
cd ~/SRC/AD-website && python3 -m venv env
|
||||
echo "
|
||||
# Set own environment variables for Django
|
||||
DJANGO_USER='alix_diwan'
|
||||
export DJANGO_USER
|
||||
DJANGO_PASSWORD='illustrations'
|
||||
export DJANGO_PASSWORD
|
||||
DJANGO_SECRET_KEY='1o&!w6785%#)gdht+o164+utq-jbd!h3_nbo9yvkf9+iq03^m6'
|
||||
export DJANGO_SECRET_KEY
|
||||
systemctl start mysqld.service" >> ~/SRC/AD-website/env/bin/activate
|
||||
fi
|
||||
|
||||
echo "Setting up LVEL-website..."
|
||||
if [ -e ~/SRC/LVEL-website ]; then
|
||||
echo "${GREEN}LVEL-website is already there.${NC}"
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updating..."
|
||||
cd ~/SRC/LVEL-website && git pull
|
||||
fi
|
||||
else
|
||||
echo "${ORANGE}Cloning new LVEL-website...${NC}"
|
||||
cd ~/SRC && git clone git@gitlab.com:flyingscorpio/LVEL-website.git
|
||||
cd ~/SRC/LVEL-website && python3 -m venv env
|
||||
echo "
|
||||
# Set own environment variables for Django
|
||||
DJANGO_USER='flyingscorpio'
|
||||
export DJANGO_USER
|
||||
DJANGO_PASSWORD='ribosome66'
|
||||
export DJANGO_PASSWORD
|
||||
DJANGO_SECRET_KEY='t!d6q&g1*lm-p41m=pd!o&kga9jk)wom)sr7#4-=\$oo*\$)ymtc'
|
||||
export DJANGO_SECRET_KEY
|
||||
systemctl start mysqld.service" >> ~/SRC/LVEL-website/env/bin/activate
|
||||
fi
|
||||
|
||||
# }}}
|
|
@ -1,56 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
## This script handles the installations for Debian-based systems.
|
||||
## It is run by main_install.sh
|
||||
|
||||
if [ "$OS" != 'debian' ]; then
|
||||
echo "${RED}The OS wasn't defined as Debian. Quitting...${NC}"
|
||||
exit 1
|
||||
else
|
||||
echo "${GREEN}Installing for Debian-based systems${NC}"
|
||||
fi
|
||||
|
||||
sudo apt update
|
||||
|
||||
echo "Installing Python venv..."
|
||||
if sudo apt install python3-venv; then
|
||||
echo "${GREEN}Successfully installed Python venv${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install Python venv${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing Keepass..."
|
||||
if sudo apt install keepass2; then
|
||||
echo "${GREEN}Successfully installed Keepass${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install Keepass${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing ProtonVPN..."
|
||||
if sudo apt install -y openvpn dialog python3-pip python3-setuptools && sudo pip3 install protonvpn-cli; then
|
||||
echo "${GREEN}Successfully installed ProtonVPN${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install ProtonVPN${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing Git..."
|
||||
if sudo apt install git; then
|
||||
echo "${GREEN}Successfully installed Git${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install Git${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing Vim..."
|
||||
# I use gvim instead of vim because the clipboard is compiled in gvim
|
||||
if sudo apt install vim-gtk; then
|
||||
echo "${GREEN}Successfully installed Vim${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install Vim${NC}"
|
||||
fi
|
||||
|
||||
echo "Installing miscellaneous things..."
|
||||
if sudo apt install curl wget; then
|
||||
echo "${GREEN}Successfully installed curl and wget${NC}"
|
||||
else
|
||||
echo "${RED}Didn't install curl and wget${NC}"
|
||||
fi
|
126
.old/i3.sh
126
.old/i3.sh
|
@ -1,126 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
## This script takes care of the i3 configuration
|
||||
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
echo "BASE_DIR wasn't set."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$GITHUB_DOTFILES" ]; then
|
||||
echo "GITHUB_DOTFILES wasn't set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install required packages {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
if [ "$OS" = 'arch' ]; then
|
||||
pacman -Qe i3-gaps || sudo pacman -S --needed i3
|
||||
sudo pacman -S --needed dunst suckless-tools
|
||||
sudo pacman -S --needed picom hsetroot rofi xsettingsd lxappearance scrot viewnior
|
||||
sudo pacman -S --needed noto-fonts
|
||||
elif [ "$OS" = 'debian' ]; then
|
||||
sudo apt install i3
|
||||
sudo apt install dunst suckless-tools
|
||||
sudo apt install compton hsetroot rofi xsettingsd lxappearance scrot viewnior
|
||||
sudo apt install fonts-noto
|
||||
else
|
||||
echo "${RED}The OS wasn't defined. Quitting...${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Add clones from GitHub {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
mkdir -p "$GITHUB_DOTFILES"
|
||||
|
||||
if [ -e "$GITHUB_DOTFILES"/i3-starterpack ]; then
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
cd "$GITHUB_DOTFILES"/i3-starterpack && git pull
|
||||
fi
|
||||
else
|
||||
cd "$GITHUB_DOTFILES" && git clone https://github.com/addy-dclxvi/i3-starterpack.git
|
||||
fi
|
||||
|
||||
if [ -e "$GITHUB_DOTFILES"/i3blocks-contrib ]; then
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
cd "$GITHUB_DOTFILES"/i3blocks-contrib && git pull
|
||||
fi
|
||||
else
|
||||
cd "$GITHUB_DOTFILES" && git clone https://github.com/vivien/i3blocks-contrib.git
|
||||
fi
|
||||
|
||||
if [ -e "$GITHUB_DOTFILES"/i3blocks-cryptocurrency ]; then
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
cd "$GITHUB_DOTFILES"/i3blocks-cryptocurrency && git pull
|
||||
fi
|
||||
else
|
||||
cd "$GITHUB_DOTFILES" && git clone https://github.com/ryanwalder/i3blocks-cryptocurrency.git
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Add config links {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Adding .Xresources and .xsettingsd"
|
||||
make_symlink ~/.Xresources "$GITHUB_DOTFILES"/i3-starterpack/.Xresources
|
||||
make_symlink ~/.xsettingsd "$GITHUB_DOTFILES"/i3-starterpack/.xsettingsd
|
||||
|
||||
echo "Adding picom.config"
|
||||
mkdir -p ~/.config
|
||||
make_symlink ~/.config/picom.conf "$BASE_DIR"/dotfiles/picom.conf
|
||||
make_symlink ~/.config/compton.conf "$BASE_DIR"/dotfiles/picom.conf
|
||||
|
||||
echo "Adding feather.ttf"
|
||||
mkdir -p ~/.fonts/icomoon
|
||||
make_symlink ~/.fonts/icomoon/feather.ttf "$GITHUB_DOTFILES"/i3-starterpack/.fonts/icomoon/feather.ttf
|
||||
|
||||
# }}}
|
||||
|
||||
# Add i3 main config {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Adding i3/config"
|
||||
mkdir -p ~/.config/i3
|
||||
make_symlink ~/.config/i3/config "$BASE_DIR"/dotfiles/i3/'config'
|
||||
|
||||
# }}}
|
||||
|
||||
# Add i3status config {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Adding i3status/config"
|
||||
mkdir -p ~/.config/i3status
|
||||
make_symlink ~/.config/i3status/config "$BASE_DIR"/dotfiles/i3/'status'
|
||||
|
||||
# }}}
|
||||
|
||||
# Add i3blocks config {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Adding i3blocks/config"
|
||||
mkdir -p ~/.config/i3blocks
|
||||
make_symlink ~/.config/i3blocks/config "$BASE_DIR"/dotfiles/i3/'blocks'
|
||||
|
||||
echo "Adding i3blocks scripts"
|
||||
mkdir -p ~/.config/i3blocks/scripts
|
||||
make_symlink ~/.config/i3blocks/scripts/arch-update "$GITHUB_DOTFILES"/i3blocks-contrib/arch-update/arch-update
|
||||
make_symlink ~/.config/i3blocks/scripts/ccurrency "$GITHUB_DOTFILES"/i3blocks-cryptocurrency/ccurrency
|
||||
make_symlink ~/.config/i3blocks/scripts/rofi-calendar "$GITHUB_DOTFILES"/i3blocks-contrib/rofi-calendar/rofi-calendar
|
||||
|
||||
# }}}
|
|
@ -1,359 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
## flyingscorpio
|
||||
## Script to automate the setting up of my working environment.
|
||||
## Uncomment the function calls in MAIN you wish to run.
|
||||
|
||||
|
||||
# 1. Set up {{{
|
||||
|
||||
RED=$(tput setaf 1)
|
||||
export RED
|
||||
GREEN=$(tput setaf 2)
|
||||
export GREEN
|
||||
ORANGE=$(tput setaf 3)
|
||||
export ORANGE
|
||||
NC=$(tput sgr0)
|
||||
export NC
|
||||
|
||||
BASE_DIR="$PWD"
|
||||
export BASE_DIR
|
||||
|
||||
GITHUB_DOTFILES=~/github_dotfiles
|
||||
export GITHUB_DOTFILES
|
||||
|
||||
make_symlink() {
|
||||
|
||||
link=$1
|
||||
target=$2
|
||||
|
||||
echo -n "Checking symlink $link..."
|
||||
if [ "$link" -ef "$target" ]; then
|
||||
echo "${GREEN} ==> OK${NC}"
|
||||
else
|
||||
echo "${RED} ==> wrong symlink or not a symlink.${NC}"
|
||||
if [ "$OVERWRITE" = 'true' ]; then
|
||||
rm "$link" 2> /dev/null
|
||||
fi
|
||||
if ln -rs "$target" "$link"; then
|
||||
echo "${ORANGE}$link symlink created${NC}"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
export -f make_symlink
|
||||
|
||||
separator() {
|
||||
exit_status=$?
|
||||
if [ $exit_status -eq 0 ]; then
|
||||
echo -n "${GREEN}"
|
||||
else
|
||||
echo -n "${RED}"
|
||||
fi
|
||||
echo "========================================"
|
||||
echo "${NC}"
|
||||
}
|
||||
|
||||
# }}}
|
||||
|
||||
# 2. 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}Unable to determine OS${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
|
||||
|
||||
separator
|
||||
|
||||
# }}}
|
||||
|
||||
# 3. Handle args {{{
|
||||
|
||||
OVERWRITE='false'
|
||||
UPDATE='false'
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "No arguments provided."
|
||||
echo "Use -o to overwrite files."
|
||||
echo "Use -u to enable updating."
|
||||
fi
|
||||
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 )
|
||||
echo "${ORANGE}You agree to overwrite preexisting files!${NC}"
|
||||
OVERWRITE='true'
|
||||
;;
|
||||
-u | --update )
|
||||
echo "${ORANGE}Set to update plugins!${NC}"
|
||||
UPDATE='true'
|
||||
;;
|
||||
* )
|
||||
echo "Din't understand arguments"
|
||||
exit 1
|
||||
esac
|
||||
fi
|
||||
|
||||
export OVERWRITE
|
||||
export UPDATE
|
||||
|
||||
separator
|
||||
|
||||
# }}}
|
||||
|
||||
# FUNCTIONS:
|
||||
|
||||
clone_projects() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Clone projects
|
||||
|
||||
echo "Cloning projects..."
|
||||
/bin/bash "$BASE_DIR"/installation_scripts/clone_projects.sh
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
configure_git() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# 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"
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
configure_protonvpn() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Configure ProtonVPN
|
||||
|
||||
echo "Configuring ProtonVPN..."
|
||||
sudo protonvpn init && sudo protonvpn c --cc CH
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
install_rust() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Install Rust
|
||||
|
||||
echo "Installing Rust..."
|
||||
if rustc --version; then
|
||||
echo "${GREEN}Rust is already intalled${NC}"
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updading..."
|
||||
rustup update
|
||||
fi
|
||||
else
|
||||
if curl https://sh.rustup.rs -sSf | sh; then
|
||||
echo "${GREEN}Successfully installed Rust${NC}"
|
||||
else
|
||||
echo "${ORANGE}There was a problem while installing Rust${NC}"
|
||||
fi
|
||||
fi
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
install_scripts() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Installing scripts..."
|
||||
|
||||
if [ "$OS" = 'debian' ]; then
|
||||
/bin/bash "$BASE_DIR"/installation_scripts/debian_based_installs.sh
|
||||
elif [ "$OS" = 'arch' ]; then
|
||||
/bin/bash "$BASE_DIR"/installation_scripts/arch_based_installs.sh
|
||||
else
|
||||
echo "${RED} Didn't receive correct OS information, quitting...${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
markdown_mimetype() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# 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}"
|
||||
mkdir -p ~/.local/share/mime/packages
|
||||
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
|
||||
update-mime-database ~/.local/share/mime
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
setup_bash_files() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Set up .bashrc
|
||||
|
||||
echo "Updating .bashrc..."
|
||||
make_symlink ~/.bashrc "$BASE_DIR"/dotfiles/bash/bashrc
|
||||
|
||||
separator
|
||||
|
||||
# Set up .bash_aliases
|
||||
|
||||
echo "Updating .bash_aliases..."
|
||||
make_symlink ~/.bash_aliases "$BASE_DIR"/dotfiles/bash/bash_aliases
|
||||
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
setup_bash_git_prompt() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Clone bash-git-prompt
|
||||
|
||||
if [ -e ~/.bash-git-prompt ]; then
|
||||
echo "${GREEN}Found existing bash-git-prompt.${NC}"
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updating..."
|
||||
cd ~/.bash-git-prompt && git pull
|
||||
fi
|
||||
else
|
||||
echo "${ORANGE}Cloning bash-git-prompt...${NC}"
|
||||
git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
|
||||
fi
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
setup_i3() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Update i3 configuration
|
||||
|
||||
echo "Setting up i3..."
|
||||
/bin/bash "$BASE_DIR"/installation_scripts/i3.sh
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
setup_sddm() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Update sddm
|
||||
|
||||
echo "Setting up SDDM..."
|
||||
/bin/bash "$BASE_DIR"/installation_scripts/sddm.sh
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
setup_vim() { # {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
# Update vim configuration
|
||||
|
||||
echo "Setting up configuration for Vim..."
|
||||
/bin/bash "$BASE_DIR"/installation_scripts/vim.sh
|
||||
separator
|
||||
|
||||
} # }}}
|
||||
|
||||
# MAIN:
|
||||
|
||||
# install_scripts
|
||||
# configure_git
|
||||
# configure_protonvpn
|
||||
# setup_bash_files
|
||||
# setup_bash_git_prompt
|
||||
# install_rust
|
||||
# setup_vim
|
||||
# setup_sddm
|
||||
# setup_i3
|
||||
# markdown_mimetype
|
||||
# clone_projects
|
39
.old/sddm.sh
39
.old/sddm.sh
|
@ -1,39 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
## This script takes care of the sddm configuration
|
||||
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
echo "BASE_DIR wasn't set."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$GITHUB_DOTFILES" ]; then
|
||||
echo "GITHUB_DOTFILES wasn't set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install required packages {{{
|
||||
|
||||
if [ "$OS" = 'arch' ]; then
|
||||
sudo pacman -S --needed sddm
|
||||
elif [ "$OS" = 'debian' ]; then
|
||||
sudo apt install sddm
|
||||
else
|
||||
echo "${RED}The OS wasn't defined. Quitting...${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Add clones from GitHub {{{
|
||||
|
||||
mkdir -p "$GITHUB_DOTFILES"
|
||||
|
||||
if [ -e "$GITHUB_DOTFILES"/delicious-sddm-theme ]; then
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
cd "$GITHUB_DOTFILES"/delicious-sddm-theme && git pull
|
||||
fi
|
||||
else
|
||||
cd "$GITHUB_DOTFILES" && git clone https://github.com/stuomas/delicious-sddm-theme.git && /bin/bash/ "$GITHUB_DOTFILES"/delicious-sddm-theme/install.sh
|
||||
fi
|
||||
|
||||
# }}}
|
185
.old/vim.sh
185
.old/vim.sh
|
@ -1,185 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
## This script takes care of the vim configuration.
|
||||
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
echo "BASE_DIR wasn't set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add .vimrc {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Adding .vimrc..."
|
||||
make_symlink ~/.vimrc "$BASE_DIR"/dotfiles/vim/vimrc
|
||||
|
||||
# }}}
|
||||
|
||||
# Add colors {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Adding colors..."
|
||||
mkdir -p ~/.vim/colors
|
||||
|
||||
color_files=$(ls "$BASE_DIR"/dotfiles/vim/colors)
|
||||
for color_file in $color_files; do
|
||||
make_symlink ~/.vim/colors/"$color_file" "$BASE_DIR"/dotfiles/vim/colors/"$color_file"
|
||||
done
|
||||
|
||||
# }}}
|
||||
|
||||
# Install or update Vundle {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Setting up Vundle..."
|
||||
if [ ! -e ~/.vim/bundle/Vundle.vim ]; then
|
||||
echo "Cloning Vundle from Github..."
|
||||
if git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim; then
|
||||
echo "${GREEN}Successfully cloned Vundle${NC}"
|
||||
else
|
||||
echo "${RED}There was a problem while setting up Vundle${NC}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Vundle is already installed, updating"
|
||||
if cd ~/.vim/bundle/Vundle.vim && git pull; then
|
||||
echo "${GREEN}Successfully updated Vundle${NC}"
|
||||
else
|
||||
echo "${RED}There was a problem while updating Vundle${NC}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Update Vundle plugins {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Checking Vundle Plugins..."
|
||||
if vim +PluginInstall +qall; then
|
||||
echo "${GREEN}All Vundle Plugins are enabled.${NC}"
|
||||
else
|
||||
echo "${RED}There was a problem while checking Vundle Plugins.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$UPDATE" = 'true' ]; then
|
||||
echo "Updating Vundle Plugins..."
|
||||
if vim +PluginUpdate +qall; then
|
||||
echo "${GREEN}Successfully updated Vundle Plugins${NC}"
|
||||
else
|
||||
echo "${RED}There was a problem while updating Vundle Plugins${NC}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Setup git-submodules for python-mode {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Setting up Python-mode folder for git submodules..."
|
||||
if [ -e ~/.vim/bundle/python-mode ]; then
|
||||
cd ~/.vim/bundle/python-mode || exit 1
|
||||
if git submodule update --init --recursive; then
|
||||
echo "${GREEN}Successfully set up submodules for python-mode${NC}"
|
||||
else
|
||||
echo "${RED}There was a problem while setting up submodules for python-mode${NC}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Install linters {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Installing linters..."
|
||||
if [ "$OS" = 'debian' ]; then
|
||||
sudo apt install flake8 pylint3 mypy shellcheck
|
||||
elif [ "$OS" = 'arch' ]; then
|
||||
sudo pacman -S --needed flake8 python-pylint mypy
|
||||
if ! sudo pacman -S --needed shellcheck; then
|
||||
echo "${ORANGE}Shellcheck was not found with pacman, downloading pre-compiled binary${NC}"
|
||||
scversion="stable"
|
||||
architechture=$(uname -m)
|
||||
if [ -e ~/Downloads/shellcheck-${scversion} ]; then
|
||||
rm -r ~/Downloads/shellcheck-${scversion} && echo "${ORANGE}Found and removed pre-existing shellcheck folder${NC}"
|
||||
fi
|
||||
cd ~/Downloads || exit 1
|
||||
echo "Downloading shellcheck ${scversion} binary for ${architechture}..."
|
||||
if wget -qO- "https://storage.googleapis.com/shellcheck/shellcheck-${scversion?}.linux.${architechture?}.tar.xz" | tar -xJv; then
|
||||
echo "${GREEN}Successfully downloaded and extracted shellcheck.${NC}"
|
||||
echo "Copying executable to /usr/bin/ ..."
|
||||
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/ && shellcheck --version
|
||||
if rm -r ~/Downloads/shellcheck-${scversion}; then
|
||||
echo "${GREEN}Removed shellcheck installation folder${NC}"
|
||||
else
|
||||
echo "${RED}Was unable to remove shellcheck installation folder${NC}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "${RED}Was unable to download shellcheck binary${NC}"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "${RED}Was unable to determine which OS you use${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Install YouCompleteMe {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Setting up YouCompleteMe..."
|
||||
if [ ! -e ~/.vim/ycm_installed ]; then
|
||||
if [ "$OS" = 'debian' ]; then
|
||||
sudo apt install build-essential cmake python3-dev
|
||||
elif [ "$OS" = 'arch' ]; then
|
||||
sudo pacman -S --needed base-devel clang cmake
|
||||
else
|
||||
echo "${RED}Was unable to determine which OS you use${NC}"
|
||||
exit 1
|
||||
fi
|
||||
cd ~/.vim/bundle/YouCompleteMe || exit 1
|
||||
if /usr/bin/python3 install.py --clang-completer --rust-completer; then
|
||||
echo "${GREEN}Successfully set up YouCompleteMe${NC}"
|
||||
cd ~/.vim || exit 1
|
||||
touch ycm_installed
|
||||
else
|
||||
echo "${RED}There was a problem while setting up YouCompleteMe${NC}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "YouCompleteMe is already installed, skipping..."
|
||||
fi
|
||||
|
||||
# }}}
|
||||
|
||||
# Add YouCompleteMe extra conf files {{{
|
||||
######
|
||||
# OK #
|
||||
######
|
||||
|
||||
echo "Adding YouCompleteMe extra_conf files..."
|
||||
|
||||
make_symlink ~/.ycm_extra_conf.py "$BASE_DIR"/dotfiles/vim/ycm_extra_conf.py
|
||||
make_symlink ~/.global_extra_conf.py "$BASE_DIR"/dotfiles/vim/global_extra_conf.py
|
||||
|
||||
# }}}
|
||||
|
||||
exit 0
|
Loading…
Add table
Reference in a new issue