Updated install.sh

This commit is contained in:
Ethan Smith-Coss 2024-10-09 17:46:04 +01:00
parent bc22cc40e0
commit b4e78af0e8
Signed by: TheOnePath
GPG Key ID: 1D351CCC6D01F32B

View File

@ -2,6 +2,7 @@
HYPRSOLUS_PATH="/usr/src/hyprsolus" HYPRSOLUS_PATH="/usr/src/hyprsolus"
HYPRSOLUSCTL_PATH="/usr/local/bin" HYPRSOLUSCTL_PATH="/usr/local/bin"
HYPRSOLUS_SYSTEMD="$HOME/.config/systemd/user"
if [[ $(id -u) -ne 0 ]] if [[ $(id -u) -ne 0 ]]
then then
@ -15,17 +16,24 @@ then
" then please run: hyprsolusctl update." " then please run: hyprsolusctl update."
exit 0 exit 0
fi fi
[[ ! -d "$HOME/.config/systemd/user" ]] && mkdir -p "$HOME/.config/systemd/user" [[ ! -d "$HYPRSOLUS_SYSTEMD" ]] && mkdir -p "$HYPRSOLUS_SYSTEMD"
echo "(hyprsolus) Installing hyprsolus to system." echo "(hyprsolus) Installing hyprsolus to system."
sudo git clone --depth=1 https://git.closedless.xyz/TheOnePath/hyprsolus.git \ sudo git clone --depth=1 https://git.closedless.xyz/TheOnePath/hyprsolus.git \
"$HYPRSOLUS_PATH" "$HYPRSOLUS_PATH"
exit_code=$? exit_code=$?
[[ $exit_code -ne 0 ]] && exit 1 [[ $exit_code -ne 0 ]] && exit 1
sudo chown -R "$USER:$USER" "$HYPRSOLUS_PATH"
echo "(hyprsolus) Moving additional scripts to system." echo "(hyprsolus) Moving additional scripts to system."
sudo cp -u "${HYPRSOLUS_PATH}/hyprsolusctl" "$HYPRSOLUSCTL_PATH" sudo cp -u "${HYPRSOLUS_PATH}/hyprsolusctl" "$HYPRSOLUSCTL_PATH"
sudo cp -ru "${HYPRSOLUS_PATH}/systemd" "$HOME/.config/systemd/" # Make the file executable
sudo chmod +x "${HYPRSOLUS_PATH}/hyprsolusctl"
sudo chown root:root "${HYPRSOLUS_PATH}/hyprsolusctl"
sudo cp -ru "${HYPRSOLUS_PATH}/systemd" "$HYPRSOLUS_SYSTEMD"
echo "(hyprsolus) Setting up systemd units."
systemctl enable --now --user hyprsolus-check.timer
echo "(hyprsolus) Installing the dependencies to system." echo "(hyprsolus) Installing the dependencies to system."
sudo sh "${HYPRSOLUS_PATH}/requirements.sh" sudo sh "${HYPRSOLUS_PATH}/requirements.sh"