From ee15506e546c3c261c90eeed099ac88508e49607 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 12 May 2025 14:37:00 +0200 Subject: [PATCH] noice --- hyprland.sh | 15 +++++++++---- neovim.sh | 4 ++-- rofi.sh | 7 +++++- template.sh | 64 +++++++++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 76 insertions(+), 14 deletions(-) diff --git a/hyprland.sh b/hyprland.sh index c9753b9..a0571d9 100644 --- a/hyprland.sh +++ b/hyprland.sh @@ -106,6 +106,8 @@ askThings() { $bar $menu $terminal + hyprshot + swww ) } @@ -113,10 +115,7 @@ instCustom() { for _d in "${advDeps[@]}"; do case "$_d" in hyprpanel) - case $distro in - arch) run _install ags-hyprpanel-git ;; - *) echo_error "Hyprpanel cannot be installed for ${YELLOW}${distro}${RED} right now.." ;; - esac + eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/hyprpanel.sh)" ;; gBar) case $distro in @@ -124,6 +123,12 @@ instCustom() { *) echo_error "gBar cannot be installed for ${YELLOW}${distro}${RED} right now.." ;; esac ;; + rofi) + eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/rofi.sh)" + ;; + swww) + eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/swww.sh)" + ;; *) checkAndInstall "$_d" ;; @@ -209,6 +214,8 @@ main() { exit 1 ;; esac + + checkConfig } if getImports; then diff --git a/neovim.sh b/neovim.sh index 5108b04..7998f9d 100644 --- a/neovim.sh +++ b/neovim.sh @@ -45,11 +45,11 @@ declare -A deps=( [debian]="depsDebian" - [ubuntu]="depsUbuntu" + [ubuntu]="depsDebian" + [opensuse]="depsOpensuse" [fedora]="depsFedora" [arch]="depsArch" [alpine]="depsAlpine" - [opensuse]="depsOpensuse" ) declare -n pkgArray="${deps[$distro]}" diff --git a/rofi.sh b/rofi.sh index d4c50c9..a621af5 100644 --- a/rofi.sh +++ b/rofi.sh @@ -79,7 +79,9 @@ main() { local rofiTemp="$(mktemp -d)" if ! command_exists rofi; then - run git clone --depth=1 https://github.com/A417ya/rofi-wayland "$rofiTemp/rofi" + echo_info "Cloning rofi to $rofiTemp/rofi" + + git clone --depth=1 https://github.com/A417ya/rofi-wayland "$rofiTemp/rofi" sleep 0.2 @@ -94,6 +96,9 @@ ninja -C build install fi + + echo_note "Cleaning up old $rofiTemp directory.." + rm -rf $rofiTemp } if getImports; then diff --git a/template.sh b/template.sh index 5ddc088..0448ade 100644 --- a/template.sh +++ b/template.sh @@ -19,20 +19,60 @@ # This only wokrs for generic package names, like neovim, or vim, or tmux etc.. # not every package packagemanager has the same packagenames for their packages.. getImports() { - i="https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh" - import="$(mktemp)" + local url="https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh" + local import="$(mktemp)" if command_exists curl; then - curl -fsSL $i -o $import + curl -fsSL $url -o $import + elif command_exists wget; then + wget -o $import $url else - echo "curl is required, but missing.." - exit 1 + echo "curl/wget is required, but missing.." + exit 69 fi source "$import" - sleep 0.3 + sleep 0.2 rm "$import" } + getDependencies() { + echo_info "Checking build dependencies.." + + # INFO: + # ╭─────────────────────────────────────────────────────────────────────────╮ + # │ You can define dependencies for various linux distros here. It will │ + # │ automagically be pulled via the $pkgArray[$distro] variable │ + # ╰─────────────────────────────────────────────────────────────────────────╯ + depsDebian=() + depsFedora=() + depsOpensuse=() + depsArch=() + depsAlpine=() + + declare -A deps=( + [debian]="depsDebian" + [ubuntu]="depsUbuntu" + [fedora]="depsFedora" + [arch]="depsArch" + [alpine]="depsAlpine" + [opensuse]="depsOpensuse" + ) + + # INFO: + # ╭────────────────────────────────────────────────────────────────╮ + # │ This variable stores the packages you provided for each distro │ + # ╰────────────────────────────────────────────────────────────────╯ + declare -n pkgArray="${deps[$distro]}" + + case "$distro" in + debian | ubuntu | arch | fedora | alpine | opensuse) checkAndInstall "${pkgArray[@]}" ;; + *) + echo_error "Cannot install for $distro" + return 69 + ;; + esac + } + main() { case "$distro" in arch) @@ -61,6 +101,16 @@ } if getImports; then - main + case "$@" in + --silent | -s) + silent=true + echo_warning "Running script silently!" + ;; + *) + silent=false + ;; + esac + getDependencies + main