This commit is contained in:
pika 2025-05-12 14:37:00 +02:00
parent f537219d62
commit ee15506e54
4 changed files with 76 additions and 14 deletions

View file

@ -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

View file

@ -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]}"

View file

@ -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

View file

@ -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 </dev/tty
fi
}