2017-10-28 23:21:46 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
2018-02-04 10:09:32 -06:00
|
|
|
REPOS='
|
2017-10-29 00:26:13 -05:00
|
|
|
[archlabs_repo]
|
2017-10-28 23:21:46 -05:00
|
|
|
Server = https://archlabs.github.io/archlabs_repo/$arch
|
|
|
|
Server = https://downloads.sourceforge.net/project/archlabs-repo/archlabs_repo/$arch'
|
2017-10-30 07:36:30 -05:00
|
|
|
|
2018-02-04 10:09:32 -06:00
|
|
|
HOME_FILES=("$HOME/bin" "$HOME/.config" "$HOME/.themes"
|
|
|
|
"$HOME/.gorice" "$HOME/.Xresources" "$HOME/.Xresources.template"
|
|
|
|
"$HOME/.mozilla" "$HOME/.zshrc" "$HOME/.bashrc"
|
|
|
|
"$HOME/.local" "$HOME/.xprofile" "$HOME/.xinitrc"
|
|
|
|
"$HOME/.icons" "$HOME/.gtkrc-2.0"
|
|
|
|
)
|
|
|
|
|
2018-02-04 10:37:23 -06:00
|
|
|
SKEL_FILES=(/etc/skel/bin /etc/skel/.config /etc/skel/.themes
|
|
|
|
/etc/skel/.Xresources /etc/skel/.gorice /etc/skel/.icons
|
|
|
|
/etc/skel/.gtkrc-2.0 /etc/skel/.xprofile /etc/skel/.xinitrc
|
|
|
|
/etc/skel/.mozilla /etc/skel/.Xresources.template
|
2018-02-04 10:09:32 -06:00
|
|
|
)
|
|
|
|
|
2017-10-30 05:17:51 -05:00
|
|
|
# Loop until network connected
|
2017-12-17 12:06:39 -06:00
|
|
|
while ! [[ $(ping -c1 8.8.8.8) ]]; do
|
2017-12-07 22:20:42 -06:00
|
|
|
echo -e "Please Connect to a Network Before Continuing"
|
|
|
|
clear; sleep 1
|
2017-10-29 09:20:48 -05:00
|
|
|
done
|
|
|
|
|
2018-02-05 21:31:56 -06:00
|
|
|
|
2018-02-04 10:09:32 -06:00
|
|
|
backup_configs() {
|
|
|
|
if ! [[ -e "$HOME/Downloads/$USER-backup.tar.gz" ]]; then
|
|
|
|
tar czvf "$HOME/Downloads/$USER-backup.tar.gz" "${HOME_FILES[@]}" >/dev/null 2>&1
|
2017-12-07 22:20:42 -06:00
|
|
|
else
|
|
|
|
echo "[WARNING] Backup already exists... Not overwriting"
|
|
|
|
sleep 2
|
|
|
|
fi
|
2017-10-30 05:17:51 -05:00
|
|
|
}
|
2017-10-28 23:21:46 -05:00
|
|
|
|
2018-02-04 10:09:32 -06:00
|
|
|
setup_configs() {
|
2017-12-07 22:20:42 -06:00
|
|
|
sudo pacman -S clutter-gtk libgee archlabs-jgmenu --needed --noconfirm
|
|
|
|
sudo pacman -S gdk-pixbuf2 pango python-yaml --needed --noconfirm
|
2018-02-04 10:37:23 -06:00
|
|
|
for f in "${SKEL_FILES[@]}"; do
|
|
|
|
cp -rf "$f" ~/
|
|
|
|
done
|
2018-02-05 21:31:56 -06:00
|
|
|
cp -f /etc/skel/.{bashrc,zshrc} ~/
|
2017-10-30 05:17:51 -05:00
|
|
|
}
|
2017-10-28 23:21:46 -05:00
|
|
|
|
2018-02-04 10:09:32 -06:00
|
|
|
new_configs() {
|
|
|
|
clear
|
|
|
|
printf "\nThis step will get the latest configs for polybar, openbox, i3 etc.
|
|
|
|
\n\nYour existing configs will be archived to:
|
|
|
|
\n\t$HOME/Downloads/$USER-backup.tar.gz\n\n\n\nDo you want to continue? [y/N]:"
|
|
|
|
read -r answer
|
|
|
|
|
|
|
|
case "$answer" in
|
|
|
|
y|yes|Y|YES)
|
|
|
|
backup_configs
|
|
|
|
if [[ -e $HOME/Downloads/$USER-backup.tar.gz ]]; then
|
|
|
|
setup_configs
|
|
|
|
fi
|
|
|
|
rm -f "$HOME/.config/keypack"
|
|
|
|
sed -i '/keypack/d' "$HOME/.config/openbox/autostart"
|
|
|
|
~/.config/setup
|
|
|
|
esac
|
|
|
|
}
|
2017-10-28 23:21:46 -05:00
|
|
|
|
2017-12-07 22:20:42 -06:00
|
|
|
if ! pacman -Q archlabs-user-skel >/dev/null 2>&1; then
|
2018-02-04 10:37:23 -06:00
|
|
|
for f in "${SKEL_FILES[@]}"; do
|
|
|
|
sudo rm -rf "$f"
|
|
|
|
done
|
2017-12-07 22:20:42 -06:00
|
|
|
sudo pacman -S archlabs-user-skel --needed --noconfirm
|
|
|
|
else
|
|
|
|
sudo pacman -Syyu --noconfirm
|
|
|
|
fi
|
|
|
|
|
2018-02-04 10:09:32 -06:00
|
|
|
new_configs
|
2017-10-29 09:20:48 -05:00
|
|
|
|
|
|
|
clear
|
2017-12-07 22:20:42 -06:00
|
|
|
echo "##########################################################
|
|
|
|
######## Setup Completed #########
|
|
|
|
##########################################################"
|
2017-10-28 23:21:46 -05:00
|
|
|
|
|
|
|
exit 0
|