52 lines
1.4 KiB
Bash
Executable File
52 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
#### 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 "\nInstall of KDE minimal (setup eudev, D-Bus, Elogind, Meta KDE Plasma)? "
|
|
if choice 2>/dev/null; then
|
|
setup-apkrepos -c -1
|
|
setup-devd udev
|
|
setup-xorg-base
|
|
apk update
|
|
apk add dbus polkit-elogind elogind networkmanager
|
|
rc-update add dbus
|
|
rc-update add polkit
|
|
rc-update add elogind
|
|
setup-desktop plasma
|
|
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
|
|
|