diff --git a/hyprland.sh b/hyprland.sh index 01f06f0..db8807b 100644 --- a/hyprland.sh +++ b/hyprland.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +PACKAGE=hyprland + # ╭───────────────╮ # │ env functions │ # ╰───────────────╯ @@ -9,6 +11,12 @@ command_exists() { command -v "$@" >/dev/null 2>&1 } +if command_exists $PACKAGE; then + echo_error "$PACKAGE is already installed!" + echo_error "Exiting now!!" + return 69 +fi + # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -53,6 +61,9 @@ checkEnv() { elif $arch; then echo_info "Using arch linux.. You really shouldn't get any errors :)" return 0 + else + echo_error "Cannot install $PACKAGE for $distro" + return 69 fi } @@ -145,10 +156,7 @@ instCustom() { eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/hyprshot.sh)" ;; gBar) - case $distro in - arch) run _install gbar-git ;; - *) echo_error "gBar cannot be installed for ${YELLOW}${distro}${RED} right now.." ;; - esac + eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/gbar.sh)" ;; rofi) eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/rofi.sh)"