From fe93a732ce5535f3ce85622af6ec690454a80ddb Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 6 Oct 2017 11:06:37 -0700 Subject: [PATCH] fix to USER persistence --- aur_packages.sh | 2 +- install_packages.sh | 3 ++- user.sh | 11 +++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/aur_packages.sh b/aur_packages.sh index 680a277..91afa3c 100755 --- a/aur_packages.sh +++ b/aur_packages.sh @@ -37,7 +37,7 @@ blue \(This may take some time.\) #Add the needed gpg key for neomutt gpg --recv-keys 5FAF0A6EE7371805 -aurcheck packer i3-gaps vim-pathogen neofetch tamzen-font-git neomutt unclutter-xfixes-git urxvt-resize-font-git polybar-git python-pywal xfce-theme-blackbird +aurcheck packer i3-gaps vim-pathogen neofetch tamzen-font-git neomutt unclutter-xfixes-git urxvt-resize-font-git polybar-git python-pywal xfce-theme-blackbird || red Error with basic AUR installations... #Also installing i3lock, since i3-gaps was only just now installed. sudo pacman -S --noconfirm --needed i3lock diff --git a/install_packages.sh b/install_packages.sh index ee05001..7a2d310 100755 --- a/install_packages.sh +++ b/install_packages.sh @@ -98,9 +98,10 @@ then sudo -u $USER bash /home/$USER/user.sh || red Error when running user.sh... rm -f /home/$USER/user.sh else - USER=$(cat .name) + USER=$(cat .name) || red Could not retreive username... blue Downloading next portion of the script \(aur_packages.sh\)... curl https://raw.githubusercontent.com/LukeSmithxyz/larbs/master/aur_packages.sh > /home/$USER/aur_packages.sh && blue Running aur_packages as $USER... sudo -u $USER bash /home/$USER/aur_packages.sh || red Error when running aur_packages... rm -f /home/$USER/aur_packages.sh fi +rm .firstrun diff --git a/user.sh b/user.sh index 374319d..398d166 100755 --- a/user.sh +++ b/user.sh @@ -1,14 +1,17 @@ #!/bin/bash -RED='\033[0;31m' -BLUE='\033[0;34m' -NC='\033[0m' + +blue() { printf "\033[0;34m $* \033[0m\n" && (echo $* >> LARBS.log) ;} +red() { printf "\033[0;31m $* \033[0m\n" && (echo ERROR: $* >> LARBS.log) ;} + +USER=$(cat .firstrun) blue Changing directory to /home/$USER... + cd /home/$USER error() { dialog --title "Error!" --msgbox "We've run into a fatal-ish error. Check the LARBS.log file for more information" 10 60 && clear && exit ;} blue Activating Pulseaudio if not already active... -pulseaudio --start +pulseaudio --start && blue Pulseaudio enabled... curl -O http://lukesmith.xyz/larbs/aur_install.sh && bash aur_install.sh rm aur_install.sh