diff --git a/docker.sh b/docker.sh index 2faf206..823b262 100644 --- a/docker.sh +++ b/docker.sh @@ -123,15 +123,29 @@ main() { } if getImports; then - case "$1" in - --silent | -s) - silent=true - echo_warning "Running the script silently.." - ;; - *) - silent=false - ;; - esac + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=docker + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done if main; then init_docker diff --git a/gbar.sh b/gbar.sh index 609c3a9..545b1de 100644 --- a/gbar.sh +++ b/gbar.sh @@ -75,6 +75,14 @@ } main() { + if $silent; then + echo_warning "Executing script silently!" + fi + + if ! getDependencies; then + echo_error "Error when installing dependencies.." + fi + case "$distro" in arch) checkAndInstall gbar-git @@ -108,16 +116,30 @@ } if getImports; then - case "$@" in - --silent | -s) - silent=true - echo_warning "Running script silently!" - ;; - *) - silent=false - ;; - esac - getDependencies + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=gbar + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main /dev/null 2>&1 } -# ─< package variable >─────────────────────────────────────────────────────────────────── -unset PACKAGE - -# ─< argument list variables >──────────────────────────────────────────────────────────── -silent=false - -sleep 0.1 - -PACKAGE=hyprgraphics -if command_exists "$PACKAGE"; then - echo "$PACKAGE is already installed!" - echo "Exiting now!" - exit 69 -fi - -# ─< parse arguments and get variable contents >────────────────────────────────────────── -for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac -done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -154,5 +130,29 @@ main() { } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=hyprgraphics + if command_exists "$PACKAGE"; then + echo "$PACKAGE is already installed!" + echo "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main fi diff --git a/hyprland.sh b/hyprland.sh index a3c3767..bd209fa 100644 --- a/hyprland.sh +++ b/hyprland.sh @@ -9,30 +9,6 @@ command_exists() { command -v "$@" >/dev/null 2>&1 } -# ─< package variable >─────────────────────────────────────────────────────────────────── -unset PACKAGE - -# ─< argument list variables >──────────────────────────────────────────────────────────── -silent=false - -sleep 0.1 - -PACKAGE=hyprland -if command_exists "$PACKAGE"; then - echo "$PACKAGE is already installed!" - echo "Exiting now!" - exit 69 -fi - -# ─< parse arguments and get variable contents >────────────────────────────────────────── -for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac -done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -322,5 +298,29 @@ main() { } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=hyprland + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main fi diff --git a/hyprlock.sh b/hyprlock.sh index 6aee5ba..cbd8dd0 100644 --- a/hyprlock.sh +++ b/hyprlock.sh @@ -7,30 +7,6 @@ command_exists() { command -v "$@" >/dev/null 2>&1 } -# ─< package variable >─────────────────────────────────────────────────────────────────── -unset PACKAGE - -# ─< argument list variables >──────────────────────────────────────────────────────────── -silent=false - -sleep 0.1 - -PACKAGE=hyprlock -if command_exists "$PACKAGE"; then - echo "$PACKAGE is already installed!" - echo "Exiting now!" - exit 69 -fi - -# ─< parse arguments and get variable contents >────────────────────────────────────────── -for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac -done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -222,5 +198,29 @@ main() { } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=hyprlock + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main fi diff --git a/hyprpanel.sh b/hyprpanel.sh index 3dbcf5f..d8f4f1b 100644 --- a/hyprpanel.sh +++ b/hyprpanel.sh @@ -32,19 +32,15 @@ getImports() { echo_warning "cleaned $import" } -if getImports; then - case "$1" in - --silent | -s) - silent=true - echo_warning "Running the script silently.." - ;; - *) - silent=false - ;; - esac -fi - main() { + if $silent; then + echo_warning "Executing script silently!" + fi + + if ! getDependencies; then + echo_error "Error when installing dependencies.." + fi + case "$distro" in arch) local deps="brightnessctl" @@ -59,4 +55,30 @@ main() { clone_to_ags } -main +if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=hyprpanel + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + + main +fi diff --git a/hyprshot.sh b/hyprshot.sh index 16ca73f..7e66bf4 100644 --- a/hyprshot.sh +++ b/hyprshot.sh @@ -6,30 +6,6 @@ command -v "$@" >/dev/null 2>&1 } - # ─< package variable >─────────────────────────────────────────────────────────────────── - unset PACKAGE - - # ─< argument list variables >──────────────────────────────────────────────────────────── - silent=false - - sleep 0.1 - - PACKAGE=hyprshot - if command_exists "$PACKAGE"; then - echo "$PACKAGE is already installed!" - echo "Exiting now!" - exit 69 - fi - - # ─< parse arguments and get variable contents >────────────────────────────────────────── - for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac - done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -129,6 +105,30 @@ } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=hyprshot + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main /dev/null 2>&1 } - # ─< package variable >─────────────────────────────────────────────────────────────────── - unset PACKAGE - - # ─< argument list variables >──────────────────────────────────────────────────────────── - silent=false - - sleep 0.1 - - PACKAGE=neovim - if command_exists "$PACKAGE"; then - echo "$PACKAGE is already installed!" - echo "Exiting now!" - exit 69 - fi - - # ─< parse arguments and get variable contents >────────────────────────────────────────── - for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac - done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -160,6 +136,30 @@ } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=neovim + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main ─────────────────────────────────────────────────────────────────── + unset PACKAGE + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + PACKAGE=postinstallation + main fi diff --git a/rofi.sh b/rofi.sh index 5a35d1b..c4ac21e 100644 --- a/rofi.sh +++ b/rofi.sh @@ -6,30 +6,6 @@ command -v "$@" >/dev/null 2>&1 } - # ─< package variable >─────────────────────────────────────────────────────────────────── - unset PACKAGE - - # ─< argument list variables >──────────────────────────────────────────────────────────── - silent=false - - sleep 0.1 - - PACKAGE=rofi - if command_exists "$PACKAGE"; then - echo "$PACKAGE is already installed!" - echo "Exiting now!" - exit 69 - fi - - # ─< parse arguments and get variable contents >────────────────────────────────────────── - for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac - done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -139,6 +115,30 @@ } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=rofi + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main /dev/null 2>&1 } - # ─< package variable >─────────────────────────────────────────────────────────────────── - unset PACKAGE - - # ─< argument list variables >──────────────────────────────────────────────────────────── - silent=false - - sleep 0.1 - - PACKAGE=swww - if command_exists "$PACKAGE"; then - echo "$PACKAGE is already installed!" - echo "Exiting now!" - exit 69 - fi - - # ─< parse arguments and get variable contents >────────────────────────────────────────── - for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac - done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -109,6 +85,30 @@ } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=swww + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main fi diff --git a/template.sh b/template.sh index 6624247..bd4c84e 100644 --- a/template.sh +++ b/template.sh @@ -6,30 +6,6 @@ command -v "$@" >/dev/null 2>&1 } - # ─< package variable >─────────────────────────────────────────────────────────────────── - unset PACKAGE - - # ─< argument list variables >──────────────────────────────────────────────────────────── - silent=false - - sleep 0.1 - - PACKAGE=packagename - if command_exists "$PACKAGE"; then - echo_warning "$PACKAGE is already installed!" - echo_warning "Exiting now!" - exit 69 - fi - - # ─< parse arguments and get variable contents >────────────────────────────────────────── - for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac - done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -135,6 +111,30 @@ } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=packagename + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main fi } diff --git a/yazi.sh b/yazi.sh index 655151d..d844560 100644 --- a/yazi.sh +++ b/yazi.sh @@ -6,30 +6,6 @@ command -v "$@" >/dev/null 2>&1 } - # ─< package variable >─────────────────────────────────────────────────────────────────── - unset PACKAGE - - # ─< argument list variables >──────────────────────────────────────────────────────────── - silent=false - - sleep 0.1 - - PACKAGE=yazi - if command_exists "$PACKAGE"; then - echo_warning "$PACKAGE is already installed!" - echo_warning "Exiting now!" - exit 69 - fi - - # ─< parse arguments and get variable contents >────────────────────────────────────────── - for arg in "$@"; do - case "$arg" in - --silent | -s) - export silent=true - ;; - esac - done - # WHY: # This import will give you the following variables: # _sudo="sudo -E" <- only if non root user @@ -80,11 +56,11 @@ declare -A deps=( [debian]="depsDebian" - [ubuntu]="depsUbuntu" - [fedora]="depsFedora" - [arch]="depsArch" - [alpine]="depsAlpine" - [opensuse]="depsOpensuse" + [ubuntu]="depsDebian" + # [fedora]="depsFedora" + # [arch]="depsArch" + # [alpine]="depsAlpine" + # [opensuse]="depsOpensuse" ) # INFO: @@ -179,6 +155,30 @@ } if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=yazi + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in + --silent | -s) + export silent=true + ;; + esac + done + main fi } diff --git a/zen-browser.sh b/zen-browser.sh index e834831..e894e49 100644 --- a/zen-browser.sh +++ b/zen-browser.sh @@ -75,6 +75,14 @@ } main() { + if $silent; then + echo_warning "Executing script silently!" + fi + + # if ! getDependencies; then + # echo_error "Error when installing dependencies.." + # fi + case "$distro" in arch) _install zen-browser-bin @@ -128,29 +136,52 @@ esac } - setup() { - if getImports; then - case "$@" in + # setup() { + # if getImports; then + # case "$@" in + # --silent | -s) + # silent=true + # echo_warning "Running script silently!" + # ;; + # *) + # silent=false + # ;; + # esac + # fi + # + # if ! command_exists zen-browser; then + # return 0 + # else + # echo_error "zen-browser does already exist on this machine!" + # return 69 + # fi + # } + + if getImports; then + # ─< package variable >─────────────────────────────────────────────────────────────────── + unset PACKAGE + + # ─< argument list variables >──────────────────────────────────────────────────────────── + silent=false + + sleep 0.1 + + PACKAGE=zen-browser + if command_exists "$PACKAGE"; then + echo_warning "$PACKAGE is already installed!" + echo_warning "Exiting now!" + exit 69 + fi + + # ─< parse arguments and get variable contents >────────────────────────────────────────── + for arg in "$@"; do + case "$arg" in --silent | -s) - silent=true - echo_warning "Running script silently!" - ;; - *) - silent=false + export silent=true ;; esac - fi + done - if ! command_exists zen-browser; then - return 0 - else - echo_error "zen-browser does already exist on this machine!" - return 69 - fi - } - - if setup "$@"; then - getDependencies main