From 245da1e59f2b775d92471972a0ce552f76742754 Mon Sep 17 00:00:00 2001 From: Cameron Miller Date: Thu, 2 Dec 2021 15:52:22 +0000 Subject: [PATCH] Script Finished --- README.org | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ cbsh_arch.sh | 47 +++++++++++++++++++++++++++++++++++++++ pkglist.txt | 1 + 3 files changed, 111 insertions(+) diff --git a/README.org b/README.org index 1fa5031..e28cb9e 100644 --- a/README.org +++ b/README.org @@ -23,6 +23,9 @@ - [[#adding-keyservers-to-gpgconf][Adding keyservers to gpg.conf]] - [[#installing-the-packages-from-the-repos][Installing the packages from the repos]] - [[#copying-over-the-configs-from-etccbsh-to-home][Copying over the configs from /etc/cbsh to $HOME]] +- [[#installing-doom-emacs][Installing DOOM Emacs!]] +- [[#the-fun-part-setting-the-default-user-shell][The Fun part, Setting the default USER shell!]] +- [[#installation-complete][Installation Complete!]] * About CBSH CBSH is the name for a set of Linux Postinstall Scripts that give you my set of programs i use and my Desktop Layout, for both Arch and Debian based distros. @@ -197,4 +200,64 @@ echo "#########################################################" [ -d /etc/cbsh ] && mkdir ~/cbsh-backup-$(date +%Y.%m.%d-%H%M) && cp -Rf /etc/cbsh ~/cbsh-backup-$(date +%Y.%m.%d-%H%M) [ ! -d ~/.config ] && mkdir ~/.config [ -d ~/.config ] && mkdir ~/.config-$(date +%Y.%m.%d-%H%M) && cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H%M) +cd /etc/dtos && sudo mv -r .config/qtile/qtile .config/qtile && cp -Rf . ~ && cd - +#+end_src + +#+begin_src bash +# Change all scipts in .local/bin to be executable. +find $HOME/.local/bin -type f -print0 | xargs -0 chmod 775 +#+end_src + + +* Installing DOOM Emacs! +#+begin_src bash +echo "#########################################################" +echo "## Installing Doom Emacs. This may take a few minutes. ##" +echo "#########################################################" +[ -d ~/.emacs.d ] && mv ~/.emacs.d ~/.emacs.d.bak.$(date +"%Y%m%d_%H%M%S") +[ -f ~/.emacs ] && mv ~/.emacs ~/.emacs.bak.$(date +"%Y%m%d_%H%M%S") +git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d +~/.emacs.d/bin/doom install +~/.emacs.d/bin/doom sync +#+end_src + + +* The Fun part, Setting the default USER shell! +#+begin_src bash +PS3='Set default USER shell (enter number): ' +shells=("fish" "zsh" "bash" "quit") +select choice in "${shells[@]}"; do + case $choice in + fish | bash | zsh) + sudo chsh $USER -s "/bin/$choice" && \ + echo -e "$choice has been set as the default USER shell for your account. \ + \nLogging out is required for this to take effect." + break + ;; + quit) + echo "User quit without changing their shell." + break + ;; + ,*) + echo "invalid option $REPLY" + ;; + esac + done +#+end_src + +* Installation Complete! +#+begin_src bash +echo "###########################################" +echo "## CBSH has been installed successfully! ##" +echo "###########################################" + +while true; do + read -p "Do you want to reboot to get into your installation of CBSH? [Y/n]" yn + case $yn in + [Yy]* ) reboot;; + [Nn]* ) break;; + "" ) reboot;; + ,* ) echo "Please answer yes or no.";; + esac + done #+end_src diff --git a/cbsh_arch.sh b/cbsh_arch.sh index b927b1b..1351ac2 100755 --- a/cbsh_arch.sh +++ b/cbsh_arch.sh @@ -79,3 +79,50 @@ echo "#########################################################" [ -d /etc/cbsh ] && mkdir ~/cbsh-backup-$(date +%Y.%m.%d-%H%M) && cp -Rf /etc/cbsh ~/cbsh-backup-$(date +%Y.%m.%d-%H%M) [ ! -d ~/.config ] && mkdir ~/.config [ -d ~/.config ] && mkdir ~/.config-$(date +%Y.%m.%d-%H%M) && cp -Rf ~/.config ~/.config-backup-$(date +%Y.%m.%d-%H%M) +cd /etc/dtos && sudo mv -r .config/qtile/qtile .config/qtile && cp -Rf . ~ && cd - + +# Change all scipts in .local/bin to be executable. +find $HOME/.local/bin -type f -print0 | xargs -0 chmod 775 + +echo "#########################################################" +echo "## Installing Doom Emacs. This may take a few minutes. ##" +echo "#########################################################" +[ -d ~/.emacs.d ] && mv ~/.emacs.d ~/.emacs.d.bak.$(date +"%Y%m%d_%H%M%S") +[ -f ~/.emacs ] && mv ~/.emacs ~/.emacs.bak.$(date +"%Y%m%d_%H%M%S") +git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d +~/.emacs.d/bin/doom install +~/.emacs.d/bin/doom sync + +PS3='Set default USER shell (enter number): ' +shells=("fish" "zsh" "bash" "quit") +select choice in "${shells[@]}"; do + case $choice in + fish | bash | zsh) + sudo chsh $USER -s "/bin/$choice" && \ + echo -e "$choice has been set as the default USER shell for your account. \ + \nLogging out is required for this to take effect." + break + ;; + quit) + echo "User quit without changing their shell." + break + ;; + *) + echo "invalid option $REPLY" + ;; + esac + done + +echo "###########################################" +echo "## CBSH has been installed successfully! ##" +echo "###########################################" + +while true; do + read -p "Do you want to reboot to get into your installation of CBSH? [Y/n]" yn + case $yn in + [Yy]* ) reboot;; + [Nn]* ) break;; + "" ) reboot;; + * ) echo "Please answer yes or no.";; + esac + done diff --git a/pkglist.txt b/pkglist.txt index 56ea191..0d41fe3 100644 --- a/pkglist.txt +++ b/pkglist.txt @@ -14,6 +14,7 @@ zsh-cbsh emacs exa fd +fish zsh git htop