Added install script

An installation script to download hyprsolus to the system.
This commit is contained in:
Ethan Smith-Coss 2024-10-09 16:01:13 +01:00
parent eefae516b2
commit 7e51e14548
Signed by: TheOnePath
GPG Key ID: 1D351CCC6D01F32B

31
install.sh Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
HYPRSOLUS_PATH="/usr/src/hyprsolus"
HYPRSOLUSCTL_PATH="/usr/local/bin"
if [[ $(id -u) -ne 0 ]]
then
echo "Please run script with root privilages."
exit 1
fi
if [[ -d "$HYPRSOLUS_PATH" ]]
then
echo "hyprsolus already installed on system. If you wish to update hyprsolus,"\
" then please run: hyprsolusctl update."
exit 0
fi
[[ ! -d "$HOME/.config/systemd/user" ]] && mkdir -p "$HOME/.config/systemd/user"
echo "(hyprsolus) Installing hyprsolus to system."
sudo git clone --depth=1 https://git.closedless.xyz/TheOnePath/hyprsolus.git \
"$HYPRSOLUS_PATH"
exit_code=$?
[[ $exit_code -ne 0 ]] && exit 1
echo "(hyprsolus) Moving additional scripts to system."
sudo cp -u "${HYPRSOLUS_PATH}/hyprsolusctl" "$HYPRSOLUSCTL_PATH"
sudo cp -ru "${HYPRSOLUS_PATH}/systemd" "$HOME/.config/systemd/"
echo "(hyprsolus) Installing the dependencies to system."
sudo sh "${HYPRSOLUS_PATH}/requirements.sh"