diff --git a/install.sh b/install.sh index be7147a..05f585d 100755 --- a/install.sh +++ b/install.sh @@ -303,22 +303,14 @@ __dep__() { instPika yazi ;; hyprland) - if ! $arch; then - instPika hyprland - else - _install hyprland hypridle hyprshot - fi + # if ! $arch; then + instPika hyprland + # else + # _install hyprland hypridle hyprshot + # fi ;; hyprpanel) - if ! command_exists hyprpanel; then - if arch; then - _install hyprpanel-ags-git - else - echo_warning "not on arch, cannot install hyprpanel.. yet.." - fi - else - echo_info "hyprpanel - already installed!" - fi + instPika hyprpanel ;; neovim) if $neovim; then @@ -333,10 +325,16 @@ __dep__() { ;; *) if ! command_exists "$hyprdots_dependency"; then - echo_note "--- installing $hyprdots_dependency ---" - _install "$hyprdots_dependency" + # echo_note "--- installing $hyprdots_dependency ---" + spin bold yellow "Installing $hyprdots_dependency.." + if run --err err _install "$hyprdots_dependency"; then + check green bold "$hyprdots_dependency was installed" + else + throw "$hyprdots_dependency could not get installed" + echo_error "${err:-}" + fi else - echo_info "$hyprdots_dependency - already installed" + repen bold green "$hyprdots_dependency - already installed" fi ;; esac @@ -360,7 +358,7 @@ pkg_optional() { ) case "$_ops" in - Y | y) + Y | y | yes) for _o_ in "${_ops[@]}"; do if command_exists "$_o_"; then echo_note "$_o_ - is already installed" @@ -377,30 +375,119 @@ pkg_optional() { } __stow__() { - stow --verbose --target="$HOME" --defer=.gitmodules --restow */ + local err + spin grey "Linking dotfiles.." + + if run --err err stow --verbose --target="$HOME" --defer=.gitmodules --restow */; then + check "Linked dotfiles!" + else + throw "Could not use stow to link dofiles.." + echo_error "${err:-}" + fi +} + +c_fonts() { + local err + local dirFonts="$HOME/.local/share/fonts/" + if [[ ! -d "$dirFonts" ]]; then + if choise "Seems like you may miss some fonts.. Do you want to clone them now to <$HOME/.local/share/fonts/>" ? [y|n]" && read -r ask_fonts + + # case "$ask_fonts" in + # [Yy]) + if ! command_exists git; then + spin "Installing fonts.." + if run pkg-install git; then + return 0 + fi + + if run --err err git clone --depth=1 https://git.k4li.de/pika/fonts.git "$dirFonts"; then + check "Cloned fonts correctly!" + else + throw "Error cloning fonts!" + echo_error "${err:-}" + fi + else + git clone --depth=1 https://git.k4li.de/pika/fonts.git "$dirFonts" + fi + # ;; + # [Nn]) + else + pen bold red "You might have some font issues, but that's your business now!" + return 0 + fi + fi +} + +c_wallpapers() { + local dirWallpaper="$HOME/.wallpapers" + if [[ ! -d "$dirWallpaper" ]]; then + if confirm "Seems like you may miss some wallpapers.. Do you want to clone them now to <$HOME/.wallpapers/> ?" ──────────────────────────────────────────────────────────────────────── + if [[ ! -f $HOME/.config/ ]]; then + pen grey "mkdir $HOME/.config" + silentexec mkdir $HOME/.config + fi + if [[ ! -f $HOME/.local/share/icons/ ]]; then + pen grey "mkdir -p $HOME/.local/share/icons/" + silentexec mkdir -p $HOME/.local/share/icons/ + fi + if [[ ! -f $HOME/.local/share/fonts/ ]]; then + c_fonts || pen grey "mkdir -p $HOME/.local/share/fonts/" && silentexec mkdir -p $HOME/.local/share/fonts/ + fi + + c_wallpapers } main() { - check_root - get_packager + mkdirs + + # check_root + # get_packager __validate__ __dep__ if ! command_exists stow; then - echo_error "we couldn't find stow on the machine, do you want us to install it? (y/n): " - read -r ask_stow - case "$ask_stow" in - Y | y) + if confirm "We couldn't find stow on the machine, do you want us to install it?"; then _install stow - ;; - *) - echo_error "You cannot proceed without installing stow! Please install manually" + else + pen red bold "You cannot proceed without installing stow! Please install manually" exit 1 - ;; - esac + fi else - echo_info "stow was found, going on to prepare to stow your config" + pen blue "Stow was found, going on to prepare to stow your config" sleep 0.3 fi @@ -409,11 +496,12 @@ main() { sleep 2 - [ "$__optional__" = "true" ] && + if $__optional__; then pkg_optional + fi __monitors__ - echo_note "found resolution ${res}" + pen blue bold "found resolution ${res}" } if getImports "https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh" && getImports "https://git.k4li.de/scripts/beddu/raw/branch/main/dist/beddu.sh"; then diff --git a/makefile b/makefile index bd3f22b..17b6518 100644 --- a/makefile +++ b/makefile @@ -1,10 +1,10 @@ all: - ./makedir.sh + # ./makedir.sh ./install.sh # stow --verbose --target=$$HOME --defer=^.*git.* --restow */ install: - ./makedir.sh + # ./makedir.sh ./install.sh # stow --verbose --target=$$HOME --defer=^.*git.* --restow */ diff --git a/zsh b/zsh index d3d137a..db7ac16 160000 --- a/zsh +++ b/zsh @@ -1 +1 @@ -Subproject commit d3d137a22bf352de190d0411a658d2e54fb13431 +Subproject commit db7ac16675938e5960b624d31426f104e5ef616d