diff --git a/modules/01-packages.sh b/modules/01-packages.sh index 6f92736..97a63b8 100755 --- a/modules/01-packages.sh +++ b/modules/01-packages.sh @@ -26,4 +26,16 @@ PACKAGES=( # Add more packages here ) -paru -S --needed --noconfirm "${PACKAGES[@]}" +to_install=() +for pkg in "${PACKAGES[@]}"; do + if ! paru -Q "$pkg" &>/dev/null; then + to_install+=("$pkg") + fi + +done + +if [ "${#to_install[@]}" -gt 0 ]; then + paru -S --noconfirm "${to_install[@]}" +else + echo "All packages already installed." +fi diff --git a/modules/03-shell.sh b/modules/03-shell.sh index ba7c6be..00eb527 100755 --- a/modules/03-shell.sh +++ b/modules/03-shell.sh @@ -7,7 +7,12 @@ fi # Set German nodeadkeys layout for TTY/console if command -v localectl >/dev/null 2>&1; then - echo "Setting TTY keyboard layout to de-latin1-nodeadkeys..." - sudo localectl set-keymap de-latin1-nodeadkeys + current_keymap=$(localectl status | awk -F': ' '/VC Keymap/ {print $2}' | xargs) + if [ "$current_keymap" != "de-latin1-nodeadkeys" ]; then + echo "Setting TTY keyboard layout to de-latin1-nodeadkeys..." + sudo localectl set-keymap de-latin1-nodeadkeys + else + echo "TTY keyboard layout already set to de-latin1-nodeadkeys." + fi fi diff --git a/modules/07-browsers.sh b/modules/07-browsers.sh index 9dad245..3fe6e3b 100755 --- a/modules/07-browsers.sh +++ b/modules/07-browsers.sh @@ -8,6 +8,17 @@ BROWSERS=(google-chrome firefox brave-bin) # Install browsers with paru (AUR helper) echo "Installing browsers: ${BROWSERS[*]}" -paru -S --needed --noconfirm "${BROWSERS[@]}" +to_install=() +for pkg in "${BROWSERS[@]}"; do + if ! paru -Q "$pkg" &>/dev/null; then + to_install+=("$pkg") + fi -echo "Browsers installed." +done + +if [ "${#to_install[@]}" -gt 0 ]; then + paru -S --noconfirm "${to_install[@]}" + echo "Browsers installed." +else + echo "All browsers already installed." +fi diff --git a/modules/50-devtools.sh b/modules/50-devtools.sh index dc9138a..bd67aaa 100755 --- a/modules/50-devtools.sh +++ b/modules/50-devtools.sh @@ -17,6 +17,17 @@ DEVTOOLS_PACKAGES=( opencode ) -paru -S --needed --noconfirm "${DEVTOOLS_PACKAGES[@]}" +to_install=() +for pkg in "${DEVTOOLS_PACKAGES[@]}"; do + if ! paru -Q "$pkg" &>/dev/null; then + to_install+=("$pkg") + fi -echo "Development tools installed." +done + +if [ "${#to_install[@]}" -gt 0 ]; then + paru -S --noconfirm "${to_install[@]}" + echo "Development tools installed." +else + echo "All development tools already installed." +fi