carbs

Cem's Auto Rice Bootstrapping Scripts
git clone git://git.ckyln.com/carbs.git
Log | Files | Refs | README | LICENSE

commit 177e3f80d23eb3e63176672abf45ffcc0fc3e1e2
Author: Cem Keylan <warc1998@gmail.com>
Date:   Fri, 24 May 2019 23:49:42 +0300

Initial Commit

Diffstat:
AREADME.md | 5+++++
Acarbs | 264+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 269 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,5 @@ +# CARBS + +## Cem's Auto Rice Bootstrapper + +Because why not? diff --git a/carbs b/carbs @@ -0,0 +1,264 @@ +#!/bin/bash + +#Default Values +export WALLPAPER=TRUE +export I3=TRUE +export EXECUTE=FALSE + +case $1 in + --dry-run) + if [ -e $HOME/fakehome ] + then + rm -r -f $HOME/fakehome + fi + mkdir $HOME/fakehome + TEST=1 + pacman="pacman -S" + HOME=$HOME/fakehome + ;; + *) + pacman="pacman -S -noconfirm" + TEST=0 + ;; +esac +mkdir $HOME/carbsinstall +CARBHOME=$HOME/carbsinstall +# Script Colors +YELLOW='\033[1;33m' +BLUE='\033[1;36m' +RED='\033[0;31m' +GREEN='\033[0;32m' +ORANGE='\033[0;33m' +NC='\033[0m' # No Color +while : +do + clear + printf "${BLUE}==================================================\n=== ====== ===== === ===== ==\n== === ==== ==== ==== == === === ==== =\n= ========= == === ==== == ==== == ==== =\n= ======== ==== == === == === ==== ======\n= ======== ==== == ==== ======= ====\n= ======== == ==== == === ======== ==\n= ======== ==== == ==== == ==== == ==== =\n== === == ==== == ==== == === === ==== =\n=== === ==== == ==== == ===== ==\n==================================================\n" + printf "${BLUE}Welcome to Cem's Auto Rice Bootsrapper Script!\n\nPlease make sure +that this is a brand new installation of Manjaro\n\n\nHere are your options:\n\n" + echo -e "Key Option Current" + echo -e " ${YELLOW}w) Default Wallpapers $WALLPAPER" + echo -e " ${YELLOW}i) Tiling Desktop $I3" + echo -e " ${YELLOW}e) Start Script" + echo -e " ${YELLOW}q) Exit Program" + printf "\nType your answer: " + read answer + case $answer in + w) + if [ $WALLPAPER = TRUE ] + then + WALLPAPER=FALSE + else + WALLPAPER=TRUE + fi + ;; + i) + if [ $I3 = TRUE ] + then + I3=FALSE + else + I3=TRUE + fi + ;; + e) + if [ $WALLPAPER = FALSE ] && [ $I3 = FALSE ] + then + echo "No option selected, quitting" + exit + fi + break + ;; + q) + exit + ;; + *) + echo That is not a valid option + ;; + esac +done +echo "Setting the installation of wallpapers to $WALLPAPER" >> $CARBHOME/.log +echo "Setting the installation of tiling desktop to $I3" >> $CARBHOME/.log +clear +echo -e "${GREEN}Starting Script${NC}" | tee -a $CARBHOME/.log +if [ $WALLPAPER = TRUE ] +then + mkdir -p $HOME/Pictures/Wallpapers && \ + echo -e "${GREEN}Created a folder to the path $HOME/Pictures/Wallpapers${NC}" &&\ + cd $HOME/Pictures && echo -e "${YELLOW}Downloading Wallpapers" &&\ + git clone https://gitlab.cemkeylan.com/cemkeylan/Wallpapers.git && echo -e "${GREEN}Downloaded Wallpapers successfully${NC}" +fi +if [ $I3 = TRUE ] +then + echo -e "${YELLOW}Installing Mandatory Packages" | tee -a $CARBHOME/.log + printf "These are:\n* compton\n* feh (wallpaper handler)\n* polybar\n* mpd (music player daemon)\n* xorg-xbacklight (screen brightness controller\n* material icons (bar icons)\n* i3-gaps tiling window manager\n\n" + if [ $TEST = 0 ] + then + sudo pacman -Syy + fi + sudo $pacman i3-gaps polybar nextcloud-client clipit compton terminator ttf-material-icons feh mpd xorg-xbacklight && echo -e "${GREEN}Installed Mandatory Packages" | tee -a $CARBHOME/.log + printf "Downloading configuration files\n" | tee -a $CARBHOME/.log + cd $CARBHOME && git clone https://gitlab.cemkeylan.com/cemkeylan/dotfiles.git && cd $CARBHOME/dotfiles && mkdir -p $HOME/.config/i3 && mkdir -p $HOME/.config/polybar && mkdir -p $HOME/.config/terminator &&\ + cp -v $PWD/.config/i3/config $HOME/.config/i3/config && cp -v $PWD/.config/polybar/config $HOME/.config/polybar/config && cp -v $PWD/.config/terminator/config $HOME/.config/terminator/config && printf "${GREEN}Sucessfully placed configuration files\n" | tee -a $CARBHOME/.log + printf "${YELLOW}Installing binaries to $HOME/bin" | tee -a $CARBHOME/.log + mkdir -p $HOME/bin + cp $PWD/bin/* $HOME/bin/ && printf " ${GREEN} Done\n" | tee -a $CARBHOME/.log + echo -e "${YELLOW}Downloading dmenu from Gitlab" | tee -a $CARBHOME/.log + cd $CARBHOME && git clone https://gitlab.cemkeylan.com/cemkeylan/dmenu.git && cd dmenu + while : + do + clear + printf "${BLUE}Would you like to configure dmenu?\n(y/n) " + read answer + case $answer in + y) + ${EDITOR-nano} $PWD/config.h + break + ;; + n) + break + ;; + *) + echo This is not a valid option + sleep 2 + ;; + esac + done + echo -e "${YELLOW}Compiling and installing dmenu" >> $CARBHOME/.log + if [ TEST = 0 ] + then + make && sudo make install && echo -e "${GREEN}Successfully installed dmenu" | tee -a $CARBHOME/.log + else + make && echo Skipping Installation because of dry run | tee -a $CARBHOME/.log + fi + while : + do + clear + printf "${RED}Should I install bashrc? This is dangerous if this is not a fresh system\n(y/n) " + read answer + case $answer in + y) + cp -f $CARBHOME/dotfiles/.bashrc $HOME/.bashrc && printf "${GREEN}Successfully installed BashRC" | tee -a $CARBSHOME/.log + break + ;; + n) + break + ;; + *) + echo -e "${RED}This is not a valid option" + sleep 2 + ;; + esac + done + while : + do + clear + printf "${BLUE}What would you prefer as your browser:\n\n${YELLOW}1) Firefox (recommended if you are not familiar to vim)\n2) qutebrowser (a browser with vim-like controls)\n\nPlease choose: ${GREEN}" + echo BROWSER INSTALLATION >> $CARBHOME/.log + read answer + printf "${YELLOW}" + case $answer in + 1) + echo Installing FIREFOX | tee -a $CARBHOME/.log + sudo $pacman firefox && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + BROWSER=firefox + printf "\n# Web Browser \nset \$brow firefox" >> $HOME/.config/i3/config + break + ;; + 2) + echo Installing QUTEBROWSER | tee -a $CARBHOME/.log + sudo $pacman qutebrowser && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + BROWSER=qutebrowser + printf "\n# Web Browser \nset \$brow qutebrowser" >> $HOME/.config/i3/config + break + ;; + *) + echo -e "${RED}This is not a valid option" + sleep 2 + ;; + esac + done + while : + do + clear + printf "${BLUE}What would you prefer as your Music Player:\n\n${YELLOW}1) ncmpcpp (Terminal-based music player that runs off mpd (Music Player Daemon)\n2) mocp (Terminal-based music player)\n3) Ario\nn) None, I will install and configure it on my own\n\nPlease choose: ${GREEN}" + echo MUSIC PLAYER INSTALLATION >> $CARBHOME/.log + read answer + printf "${YELLOW}" + case $answer in + 1) + echo Installing NCMPCPP | tee -a $CARBHOME/.log + sudo $pacman ncmpcpp && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + printf "\n#Music Player \nset \$music \$term -e \"ncmpcpp --port 6601 && exit\"\n" >> $HOME/.config/i3/config + break + ;; + 2) + echo Installing MOCP | tee -a $CARBHOME/.log + sudo $pacman moc && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + printf "\n#Music Player \nset \$music \$term -e \"mocp && exit\"\n" >> $HOME/.config/i3/config + break + ;; + 3) + echo Installing Ario | tee -a $CARBHOME/.log + sudo $pacman ario && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + printf "\n#Music Player \nset \$music ario\n" >> $HOME/.config/i3/config + break + ;; + n) + echo -e "$USER opted out of music player" >> $CARBHOME/.log + break + ;; + *) + echo -e "${RED}This is not a valid option" + sleep 2 + ;; + esac + done + while : + do + clear + printf "${BLUE}What would you prefer as your File Manager:\n\n${YELLOW}1) lf (Terminal-based file manager)\n2) Nemo (qt file manager)\n3) Dolphin\n\nPlease choose: ${GREEN}" + read answer + printf "${YELLOW}" + case $answer in + 1) + echo Installing lf | tee -a $CARBHOME/.log + yay -S lf && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + printf "\n# File Manager \nset \$fm \$term -e \"lf && exit\"\n" >> $HOME/.config/i3/config + break + ;; + 2) + echo Installing Nemo | tee -a $CARBHOME/.log + sudo $pacman nemo && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + printf "\n# File Manager \nset \$fm nemo\n" >> $HOME/.config/i3/config + break + ;; + 3) + echo Installing Dolphin | tee -a $CARBHOME/.log + sudo $pacman dolphin && echo -e "${GREEN}Installed successfully" | tee -a $CARBHOME/.log + printf "\n# File Manager \nset \$fm dolphin\n" >> $HOME/.config/i3/config + break + ;; + *) + echo -e "${RED}This is not a valid option" + sleep 2 + ;; + esac + done + if [ TEST = 0 ] + then + printf "${GREEN}The script is finished, should I restart your display manager?\n(yes/no) " + read answer + case $answer in + yes) + sudo systemctl restart display-manager + ;; + *) + echo Exiting + exit + ;; + esac + else + echo Exiting + fi +fi +