2022-03-25 16:55:24 -04:00
|
|
|
# Set vars
|
2022-03-24 02:41:08 -04:00
|
|
|
LOC=$1
|
2022-03-24 02:57:30 -04:00
|
|
|
LOCAL_USER=$2
|
2022-03-24 01:18:23 -04:00
|
|
|
|
2022-03-25 16:55:24 -04:00
|
|
|
# unarchive your files
|
2022-03-25 13:48:34 -04:00
|
|
|
7z x $LOC -o./files/temp/
|
|
|
|
|
2022-03-25 16:55:24 -04:00
|
|
|
# try staging laptop stuff, if that fails do desktop stuff
|
2022-03-25 13:48:34 -04:00
|
|
|
mv ./files/temp/Laptop ./files/temp/$LOCAL_USER/ ||\
|
|
|
|
mv ./files/temp/Desktop ./files/temp/$LOCAL_USER/
|
|
|
|
|
2022-03-25 16:55:24 -04:00
|
|
|
# copy the files to where theyre supposed to go on the system
|
2022-03-24 02:57:30 -04:00
|
|
|
cp -vR ./files/temp/$LOCAL_USER/* /home/$LOCAL_USER/
|
2022-03-24 01:52:07 -04:00
|
|
|
|
2022-03-25 16:55:24 -04:00
|
|
|
# change ownership of the user's stuff so you dont have privilege issues
|
2022-03-24 02:57:30 -04:00
|
|
|
chown -R $LOCAL_USER /home/$LOCAL_USER
|
|
|
|
chgrp -R $LOCAL_USER /home/$LOCAL_USER
|
2022-03-24 02:45:27 -04:00
|
|
|
|
2022-03-25 16:55:24 -04:00
|
|
|
# make neofetch config folders
|
|
|
|
mkdir ~/.config
|
|
|
|
mkdir ~/.config/neofetch
|
|
|
|
|
|
|
|
# delete any default configs in root so that they can be set properly
|
2022-03-24 02:45:27 -04:00
|
|
|
rm ~/.zshrc
|
|
|
|
rm ~/.config/neofetch/config.conf
|
|
|
|
rm ~/.gitconfig
|
|
|
|
|
2022-03-25 16:55:24 -04:00
|
|
|
# link some stuff do the unpriv users' stuff
|
|
|
|
# NOTE: The way I was linking zshrc is potentially dangerous since it would allow for priv esc from the unpriv user to
|
|
|
|
# root privilege. Don't do this. It is dumb lol.
|
|
|
|
# ln -s /home/$LOCAL_USER/.zshrc ~/.zshrc
|
|
|
|
# As far as I know the config files dont run code, so its safe to link them so they will auto update if you change them as your normal user
|
|
|
|
cp /home/$LOCAL_USER/.zshrc ~/.zshrc
|
2022-03-24 02:57:30 -04:00
|
|
|
ln -s /home/$LOCAL_USER/.config/neofetch/config.conf ~/.config/neofetch/config.conf
|
|
|
|
ln -s /home/$LOCAL_USER/.gitconfig ~/.gitconfig
|
|
|
|
|
2022-03-25 16:55:24 -04:00
|
|
|
# add my bashrc additions to root and the local user
|
2022-03-24 02:57:30 -04:00
|
|
|
echo `cat ./files/.bashrc` >> /home/$LOCAL_USER/.bashrc
|
|
|
|
echo `cat ./files/.bashrc` >> ~/.bashrc
|