diff --git a/alpine/apps/extra-kde-apps.sh b/alpine/apps/extra-kde-apps.sh new file mode 100755 index 0000000..78f7026 --- /dev/null +++ b/alpine/apps/extra-kde-apps.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +PKG_KDE_APPS="kcalc dolphin-plugins elisa vlc-qt" + +#### Functions +check_root() { + if [ "$(id -u)" -ne 0 ]; then + echo "Must be root to run $0" + exit + fi +} + +choice() { + local prompt="$1" + local default="${2:-Y}" # Default to Y if not specified + local response + + while true; do # Loop until valid input + read -rp "$prompt [Y/n/c] " -n 1 response + echo # New line after input + + # Use default if input is empty + response=${response:-$default} + + case "$response" in + [Yy]* ) return 0;; # Yes: return 0 + [Nn]* ) return 1;; # No: return 1 + [Cc]* ) return 2;; # Cancel: return 2 + * ) echo "Invalid input. Please enter Y (Yes), n (No), or c (Cancel)." >&2;; + esac + done +} + +#### Main +check_root + +echo -ne "\nYou want to install KDE apps ($PKG_KDE_APPS)? " +if choice 2>/dev/null; then + apk add $PKG_KDE_APPS +fi \ No newline at end of file diff --git a/alpine/apps/flatpak.sh b/alpine/apps/flatpak.sh new file mode 100755 index 0000000..5edc184 --- /dev/null +++ b/alpine/apps/flatpak.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +PKG_FLATPAK="discover-backend-flatpak flatpak" + +#### Functions +check_root() { + if [ "$(id -u)" -ne 0 ]; then + echo "Must be root to run $0" + exit + fi +} + +choice() { + local prompt="$1" + local default="${2:-Y}" # Default to Y if not specified + local response + + while true; do # Loop until valid input + read -rp "$prompt [Y/n/c] " -n 1 response + echo # New line after input + + # Use default if input is empty + response=${response:-$default} + + case "$response" in + [Yy]* ) return 0;; # Yes: return 0 + [Nn]* ) return 1;; # No: return 1 + [Cc]* ) return 2;; # Cancel: return 2 + * ) echo "Invalid input. Please enter Y (Yes), n (No), or c (Cancel)." >&2;; + esac + done +} + +#### Main +check_root + +echo -ne "\nYou want to install support for Flatpak ($PKG_FLATPAK)? " +if choice 2>/dev/null; then + apk add $PKG_FLATPAK + flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + +fi diff --git a/alpine/apps/libreoffice.sh b/alpine/apps/libreoffice.sh new file mode 100755 index 0000000..31c575d --- /dev/null +++ b/alpine/apps/libreoffice.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +PKG_OFFICE="libreoffice-calc libreoffice-writer libreoffice-draw libreoffice-kf6" + +#### Functions +check_root() { + if [ "$(id -u)" -ne 0 ]; then + echo "Must be root to run $0" + exit + fi +} + +choice() { + local prompt="$1" + local default="${2:-Y}" # Default to Y if not specified + local response + + while true; do # Loop until valid input + read -rp "$prompt [Y/n/c] " -n 1 response + echo # New line after input + + # Use default if input is empty + response=${response:-$default} + + case "$response" in + [Yy]* ) return 0;; # Yes: return 0 + [Nn]* ) return 1;; # No: return 1 + [Cc]* ) return 2;; # Cancel: return 2 + * ) echo "Invalid input. Please enter Y (Yes), n (No), or c (Cancel)." >&2;; + esac + done +} + +#### Main +check_root + +echo -ne "\nYou want to install office packages ($PKG_OFFICE)? " +if choice 2>/dev/null; then + apk add $PKG_OFFICE +fi diff --git a/alpine/desktop-environment/clean-install-kde.sh b/alpine/desktop-environment/clean-install-kde.sh index 06220e8..57410c3 100755 --- a/alpine/desktop-environment/clean-install-kde.sh +++ b/alpine/desktop-environment/clean-install-kde.sh @@ -1,10 +1,5 @@ #!/bin/sh -PKG_KDE_APPS="kcalc dolphin-plugins elisa vlc-qt" -PKG_OFFICE="libreoffice-calc libreoffice-writer libreoffice-draw libreoffice-kf6" -PKG_NET="thunderbird net-tools remmina" -PKG_FLATPAK="discover-backend-flatpak flatpak" - #### Functions check_root() { if [ "$(id -u)" -ne 0 ]; then @@ -51,26 +46,6 @@ if choice 2>/dev/null; then sed -i "s#^DisplayServer=wayland\$#DisplayServer=x11#" /etc/sddm.conf.d/plasma-wayland.conf # Bug https://gitlab.alpinelinux.org/alpine/aports/-/issues/16802 rc-update del networking boot rc-update add networkmanager boot + echo "Please reboot OS .." fi -echo -ne "\nYou want to install KDE apps ($PKG_KDE_APPS)? " -if choice 2>/dev/null; then - apk add $PKG_KDE_APPS -fi - -echo -ne "\nYou want to install office packages ($PKG_OFFICE)? " -if choice 2>/dev/null; then - apk add $PKG_OFFICE -fi - -echo -ne "\nYou want to install internet programs ($PKG_NET)? " -if choice 2>/dev/null; then - apk add $PKG_NET -fi - -echo -ne "\nYou want to install support for Flatpak ($PKG_FLATPAK)? " -if choice 2>/dev/null; then - apk add $PKG_FLATPAK - flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo - -fi