From 7e51e14548ed1fa778df611d94c12f5614aba65f Mon Sep 17 00:00:00 2001 From: TheOnePath Date: Wed, 9 Oct 2024 16:01:13 +0100 Subject: [PATCH] Added install script An installation script to download hyprsolus to the system. --- install.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..0912fcf --- /dev/null +++ b/install.sh @@ -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"