From 4fb0d17980410eb2562e3c5074c625b6c0ca5247 Mon Sep 17 00:00:00 2001 From: Johannes Kamprad Date: Tue, 9 Feb 2021 21:01:20 +0100 Subject: [PATCH] Update setup.sh change to fit chrooted_cleaner_script.sh needs and adding variable to get new user name. --- setup.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/setup.sh b/setup.sh index 6f9c69f..9b80210 100644 --- a/setup.sh +++ b/setup.sh @@ -1,13 +1,19 @@ -#bin/sh -git clone https://github.com/OdiousImp2604/Sway-EndeavourOS.git -pushd SwayEOS >/dev/null -cp -R .config /home/$NEW_USER/ -cp -R .config ~/ -cp .profile ~/ +#bin/bash + +if [ -f /tmp/new_username.txt ] +then + NEW_USER=$(cat /tmp/new_username.txt) +else + NEW_USER=$(cat /tmp/$chroot_path/etc/passwd | grep "/home" |cut -d: -f1 |head -1) +fi + +git clone https://github.com/killajoe/SwayEOS.git +cd SwayEOS +cp -R .config /home/$NEW_USER/ +chmod -R +x /home/$NEW_USER/.config/sway/scripts +chmod +x /home/$NEW_USER/.config/waybar/scripts/weather.sh cp .profile /home/$NEW_USER/ -cp lightdm-gtk-greeter.conf /etc/lightdm/ -chmod -R +x ~/.config/Sway/scripts /home/$NEW_USER/.config/Sway/scripts -chmod +x ~/home/$NEW_USER/.config/waybar/scripts/weather.sh -chown -R $NEW_USER:users /home/$NEW_USER/.config /home/$NEW_USER/.profile -popd >/dev/null +chown -R $NEW_USER:$NEW_USER /home/$NEW_USER/.config +chown $NEW_USER:$NEW_USER /home/$NEW_USER/.profile +cd .. rm -rf SwayEOS