addet remove function

This commit is contained in:
pika 2025-05-24 12:28:27 +02:00
parent 5c74497d14
commit 7a3541e4c4

View file

@ -56,6 +56,11 @@ askThings() {
pen grey "$terminal was picked" pen grey "$terminal was picked"
line line
removeUnwanted=false
if confirm "Do you want to also remove conflicting packages?"; then
removeUnwanted=true
fi
advDeps=( advDeps=(
"${menu:-rofi}" "${menu:-rofi}"
"${terminal:-foot}" "${terminal:-foot}"
@ -71,22 +76,22 @@ instCustom() {
case "$_d" in case "$_d" in
hyprpanel | hyprlock | hyprshot | gBar | rofi | swww) hyprpanel | hyprlock | hyprshot | gBar | rofi | swww)
# eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/hyprpanel.sh)" # eval "$(curl -fsSL https://git.k4li.de/scripts/installs/raw/branch/main/hyprpanel.sh)"
source_script https://git.k4li.de/scripts/installs/raw/branch/main/$_d.sh source-script https://git.k4li.de/scripts/installs/raw/branch/main/$_d.sh
;; ;;
# hyprlock) # hyprlock)
# source_script https://git.k4li.de/scripts/installs/raw/branch/main/hyprlock.sh # source-script https://git.k4li.de/scripts/installs/raw/branch/main/hyprlock.sh
# ;; # ;;
# hyprshot) # hyprshot)
# source_script https://git.k4li.de/scripts/installs/raw/branch/main/hyprshot.sh # source-script https://git.k4li.de/scripts/installs/raw/branch/main/hyprshot.sh
# ;; # ;;
# gBar) # gBar)
# source_script https://git.k4li.de/scripts/installs/raw/branch/main/gBar.sh # source-script https://git.k4li.de/scripts/installs/raw/branch/main/gBar.sh
# ;; # ;;
# rofi) # rofi)
# source_script https://git.k4li.de/scripts/installs/raw/branch/main/rofi.sh # source-script https://git.k4li.de/scripts/installs/raw/branch/main/rofi.sh
# ;; # ;;
# swww) # swww)
# source_script https://git.k4li.de/scripts/installs/raw/branch/main/swww.sh # source-script https://git.k4li.de/scripts/installs/raw/branch/main/swww.sh
# ;; # ;;
none) none)
return return
@ -124,6 +129,8 @@ cloneDotfiles() {
pen blue bold "Dotfiles installed successfully!" pen blue bold "Dotfiles installed successfully!"
;; ;;
own) own)
pen bold red "Warning: This does only clone the dotfiles into $HOME/dotfiles, you have to install them yourself!"
lin
request customDots "Type in the url of your hyprland dotfiles:" </dev/tty request customDots "Type in the url of your hyprland dotfiles:" </dev/tty
sleep 1 sleep 1
spin blue bold "Getting your dotfiles from $customDots" spin blue bold "Getting your dotfiles from $customDots"
@ -234,6 +241,17 @@ getDependencies() {
esac esac
} }
remove-unwanted() {
local arr=(
mako
nano
dunst
hyprpaper
)
check-and-remove ${arr[@]}
}
setup-env() { setup-env() {
# local beddu=https://git.k4li.de/scripts/beddu/raw/branch/main/dist/beddu.sh # local beddu=https://git.k4li.de/scripts/beddu/raw/branch/main/dist/beddu.sh
# local pika=https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh # local pika=https://git.k4li.de/scripts/imports/raw/branch/main/distros.sh
@ -269,22 +287,26 @@ main() {
askThings askThings
if $silent; then if $silent; then
echo_warning "Executing script silently!" pen bold yellow "Executing script silently!"
else
silent=false
fi fi
getDependencies getDependencies
# remove conflicting packages if the user confirmed it
if $removeUnwanted; then
remove-unwanted
fi
instCustom instCustom
if [[ ! -d "$HOME/dotfiles" ]]; then if [[ ! -d "$HOME/dotfiles" ]]; then
cloneDotfiles cloneDotfiles
fi fi
clone # clone
# checkConfig # checkConfig
} }
if setup-env; then if setup-env; then
# ─< package variable >─────────────────────────────────────────────────────────────────── # ─< package variable >───────────────────────────────────────────────────────────────────
unset PACKAGE unset PACKAGE