commit 47d335317fe2ed8c50665fb6718d404bfcead316 Author: Ivan Jurišić Date: Mon Feb 21 12:20:50 2022 +0100 diff --git a/debian-clean-kde.sh b/debian-clean-kde.sh new file mode 100755 index 0000000..bd8b7ab --- /dev/null +++ b/debian-clean-kde.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +#### Variables +APT_UPDATE="apt -y update" +APT_INST="apt -y install" +APT_PURGE="apt -y purge" +APT_REMOVE="apt -y autoremove" + +PKG_KDE_MINIMAL="kde-plasma-desktop plasma-nm" +PKG_KDE_APPS="ark kcalc okular gwenview krita dolphin-plugins kde-spectacle juk dragonplayer kdenetwork-filesharing" +PKG_OFFICE="libreoffice libreoffice-kf5 aspell-hr hunspell-hr" +PKG_NET="thunderbird net-tools remmina" +PKG_NVIDIA="nvidia-driver" +PKG_CHAT="element-desktop telegram-desktop" + +PKG_KDE_PURGE="kdeconnect termit" + +#### Functions +check_root() { + if [ "$EUID" -ne 0 ]; then + echo "Must be root to run $0" + exit + fi +} +package_firefox() { + if (dpkg --list 'firefox' | grep un | cut -f 3 -d ' ') 2>/dev/null; then + PKG_FIREFOX="firefox-esr" + else + PKG_FIREFOX="firefox" + fi +} +choice() { + echo -ne "[y/n]" + while true + do + read -rN1 input + case $input in + [yY][eE][sS]|[yY]) + return 0 + + break + ;; + [nN][oO]|[nN]) + return 1 + ;; + esac + done +} + +#### Main + +check_root + +echo -e "\nUpdate apt" +echo "$APT_UPDATE" +$APT_UPDATE + + +echo -ne "\nInstall of KDE minimal ($PKG_KDE_MINIMAL)? " +if choice 2>/dev/null; then + echo -ne "\n$APT_INST $PKG_KDE_MINIMAL\n" + $APT_INST $PKG_KDE_MINIMAL +fi + + +echo -ne "\nYou want remove package from KDE minimal ($PKG_KDE_PURGE)? " +if choice 2>/dev/null; then + echo -ne "\n$APT_PURGE $PKG_KDE_PURGE\n" + $APT_PURGE $PKG_KDE_PURGE + echo "$APT_REMOVE" + $APT_REMOVE +fi + +echo -ne "\nYou want to install KDE apps ($PKG_KDE_APPS)? " +if choice 2>/dev/null; then + echo -ne "\n$APT_INST $PKG_KDE_APPS\n" + $APT_INST $PKG_KDE_APPS +fi + +echo -ne "\nYou want to install office packages ($PKG_OFFICE)? " +if choice 2>/dev/null; then + echo -ne "\n$APT_INST $PKG_OFFICE\n" + $APT_INST $PKG_OFFICE +fi + +package_firefox +echo -ne "\nYou want to install internet programs ($PKG_FIREFOX $PKG_NET)? " +if choice 2>/dev/null; then + echo -ne "\n$APT_INST $PKG_FIREFOX $PKG_NET\n" + $APT_INST $PKG_FIREFOX $PKG_NET +fi + +echo -ne "\nYou want to install NVIDIA Proprietary driver ($PKG_NVIDIA)? " +if choice 2>/dev/null; then + echo -ne "\nAdd support for i386 packages\n" + dpkg --add-architecture i386 + $APT_UPDATE + echo -ne "\n$APT_INST $PKG_NVIDIA\n" + $APT_INST $PKG_NVIDIA +fi + +echo -ne "\nYou want to install chat programs ($PKG_CHAT)? " +if choice 2>/dev/null; then + echo -ne "\nAdd repository for Element client\n" + $APT_INST apt-transport-https wget + wget -O /usr/share/keyrings/riot-im-archive-keyring.gpg https://packages.riot.im/debian/riot-im-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/riot-im-archive-keyring.gpg] https://packages.riot.im/debian/ default main" | sudo tee /etc/apt/sources.list.d/riot-im.list + $APT_UPDATE + echo -ne "\n$APT_INST $PKG_CHAT\n" + $APT_INST $PKG_CHAT +fi