From 9207cf4ae25945923dfc7aafda524c5e6efd2939 Mon Sep 17 00:00:00 2001 From: zulumann Date: Thu, 10 Apr 2025 11:44:33 +0200 Subject: [PATCH] 2025.04.10_11:44 --- LMDE_Flatpack.sh | 139 +++++++++++++++++++++++++++++++++ LMDE_KVM.sh | 117 ++++++++++++++++++++++++++++ LMDE_SetupHome.sh | 191 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 447 insertions(+) create mode 100644 LMDE_Flatpack.sh create mode 100644 LMDE_KVM.sh create mode 100644 LMDE_SetupHome.sh diff --git a/LMDE_Flatpack.sh b/LMDE_Flatpack.sh new file mode 100644 index 0000000..ef00460 --- /dev/null +++ b/LMDE_Flatpack.sh @@ -0,0 +1,139 @@ +#!/bin/sh +# +if [ ! -f /etc/debian_version ]; then + echo "Unsupported Linux Distribution. Prepared for Debian" + exit 1 +fi +################################################################################ +# +# +# Install Flatpaks @Linux Mint / LMDE / Debian +# +# +################################################################################ +# +while : +do +clear +echo "" +echo "\033[1m I N S T A L L Flatpak @ LinuxMint22 " +echo " -----------------------------------------" +echo "\033[0m" +echo "01.Setup Flatpak Themes" +echo "-----------------------------------------" +echo "02.Install Flatseal" +echo "03.Install Flatsweep" +echo "04.Install SaveDesktop" +echo "-----------------------------------------" +echo "05.Install Bitwarden" +echo "06.Install Cryptomator" +echo "07.Install FreeTube" +echo "08.Install Jellyfin-Media-Player" +echo "09.Install Cozy" +echo "-----------------------------------------" +echo "10.Install Lutris" +echo "11.Install Heroric" +echo "12.Install Bottles" +echo "13.ProtonUp-Qt" +echo " -----------------------------------------" +echo "" +echo " x. Exit" +echo "" +echo -n " Please enter option [01 - 13]" +read opt +case $opt in +################################################################################## +01) echo "************ Setup Flatpak Themes Arc-Dark **********************"; +################################################################################## +# Step 1: Give Flatpak apps access to GTK themes and icons location +sudo cp -r /usr/share/icons/Papirus-Dark ~/.icons/ +sudo cp -r /usr/share/icons/ePapirus-Dark ~/.icons/ +sudo cp -r /usr/share/themes/Arc-Dark ~/.themes/ + +sudo flatpak override --filesystem=$HOME/.themes +sudo flatpak override --filesystem=$HOME/.icons + +# Step 2: Tell Flatpak apps which theme/icon to use +sudo flatpak override --env=GTK_THEME=Arc-Dark +sudo flatpak override --env=ICON_THEME=Papirus-Dark +# sudo flatpak override --env=ICON_THEME=Papirus-Yaru-Dark +;; + +################################################################################## +02) echo "************ Install Flatseal ****************"; +################################################################################## +flatpak install -y flathub com.github.tchx84.Flatseal +;; + +################################################################################## +03) echo "************ Install Flatsweep **************************"; +################################################################################## +flatpak install -y flathub io.github.giantpinkrobots.flatsweep +;; + +################################################################################## +04) echo "************ Install SaveDesktop **************************"; +################################################################################## +flatpak install -y flathub io.github.vikdevelop.SaveDesktop +;; + +################################################################################## +05) echo "************ Install Bitwarden ******************"; +################################################################################## +flatpak install -y flathub com.bitwarden.desktop +;; + +################################################################################## +06) echo "************ Install Cryptomator **************************"; +################################################################################## +flatpak install -y flathub org.cryptomator.Cryptomator +;; + +################################################################################## +07) echo "************ Install FreeTube *****************"; +################################################################################## +flatpak install -y flathub io.freetubeapp.FreeTube +;; + +################################################################################## +08) echo "************ Install Jellyfin-Media-Player **************************"; +################################################################################## +flatpak install -y flathub com.github.iwalton3.jellyfin-media-player +;; + +################################################################################## +09) echo "************ Install Cozy **************************"; +################################################################################## +flatpak install -y flathub com.github.geigi.cozy +;; + +################################################################################## +10) echo "************ Install Lutris **************************"; +################################################################################## +flatpak install -y flathub net.lutris.Lutris +;; + +################################################################################## +11) echo "************ Install Heroric **************************"; +################################################################################## +flatpak install -y flathub com.heroicgameslauncher.hgl +;; + +################################################################################## +12) echo "************ Install Bottles **************************"; +################################################################################## +flatpak install -y flathub com.usebottles.bottles +;; + +################################################################################## +13) echo "************ Install ProtonUp-Qt **************************"; +################################################################################## +flatpak install -y flathub net.davidotek.pupgui2 +;; + +x) echo ""; +exit 1;; +*) echo " Press [enter] key to continue. . ."; +read enterKey;; +esac +done \ No newline at end of file diff --git a/LMDE_KVM.sh b/LMDE_KVM.sh new file mode 100644 index 0000000..9a8df7e --- /dev/null +++ b/LMDE_KVM.sh @@ -0,0 +1,117 @@ +#!/bin/sh +# +if [ ! -f /etc/debian_version ]; then + echo "Unsupported Linux Distribution. Prepared for Debian" + exit 1 +fi +################################################################################ +# +# +# Install KVM @Linux Mint / Linux Mint Debian Edition +# +# +################################################################################ +# +# Preperations: +# - Warning your GPU has to support UEFI. +# - Check if your motherboard BIOS version is recent. (this can help you with having better IOMMU groups) +# - Check if your system is installed in UEFI mode. (CSM disabled in bios for AMD) +# +# AMD: +# - IOMMU = enabled +# - NX mode = enabled +# - SVM mode = enabled +# +################################################################################ +# +# wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso +# +# https://www.youtube.com/watch?v=_JTEsQufSx4 +# +################################################################################ +# +# journalctl -xeu libvirtd.service +# +################################################################################ +sudo apt install -y \ + qemu-kvm \ + qemu-system \ + libvirt-clients \ + libvirt-daemon-system \ + bridge-utils \ + virt-manager \ + ovmf \ + swtpm \ + virgl-server \ + libvirglrenderer1 \ + libguestfs-tools \ + libosinfo-bin + + +echo -e '\033[33m------Enable IOMMU------\033[33m' +echo -e "\033[0m" +sleep 2 +sudo cp /etc/default/grub /etc/default/grub_kvm + +#Debian +#sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=""/GRUB_CMDLINE_LINUX_DEFAULT="amd_iommu=on iommu=pt video=efifb:off quiet splash"/g' /etc/default/grub + +#LMDE +sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="amd_iommu=on iommu=pt video=efifb:off quiet splash"/g' /etc/default/grub + +sudo update-grub + + +echo -e '\033[33m------Configuring of Libvirt------\033[33m' +echo -e "\033[0m" +sleep 2 +sudo sed -i 's/#unix_sock_group = "libvirt"/unix_sock_group = "libvirt"/g' /etc/libvirt/libvirtd.conf +sudo sed -i 's/#unix_sock_rw_perms = "0770"/unix_sock_rw_perms = "0770"/g' /etc/libvirt/libvirtd.conf + +# IMPORTANT: You need this for detailed logs: +echo -e 'log_filters="1:qemu"' | sudo tee -a /etc/libvirt/libvirtd.conf +echo -e 'log_outputs="1:file:/var/log/libvirt/libvirtd.log"' | sudo tee -a /etc/libvirt/libvirtd.conf + +sudo usermod -a -G libvirt $(whoami) + +#sudo sed -i 's/#user = "root"/user = "zulumann"/g' /etc/libvirt/qemu.conf +echo -e 'user = "zulumann"' | sudo tee -a /etc/libvirt/qemu.conf + +sudo systemctl enable --now libvirtd + +# Verify libvirt has been added to your users: +# sudo groups $(whoami) + + +echo -e '\033[33m------Configuring QEMU------\033[33m' +echo -e "\033[0m" +sleep 2 +sudo cp /etc/libvirt/qemu.conf /etc/libvirt/qemu.conf.default + +sudo sed -i 's/#user = "libvirt-qemu"/user = "zulumann"/g' /etc/libvirt/qemu.conf +sudo sed -i 's/#group = "libvirt-qemu"/group = "zulumann"/g' /etc/libvirt/qemu.conf + +sudo usermod -a -G kvm,libvirt $(whoami) + +# Verify libvirt and kvm has been added to your users groups: +# sudo groups $(whoami) + + +echo -e '\033[33m------Enabling the virtual machine default network------\033[33m' +echo -e "\033[0m" +sleep 2 +sudo virsh net-autostart default && sudo virsh net-start default + + +echo -e '\033[33m------Enabling copy-and-paste between the guest and the host------\033[33m' +echo -e "\033[0m" +sleep 2 +sudo apt install spice-vdagent +sudo systemctl enable --now spice-vdagentd.service + + +echo -e '\033[33m------Setup Directorys------\033[33m' +echo -e "\033[0m" +sleep 2 +# mkdir -p /home/$USER/VM-Images && sudo chown :kvm ~/VM-Images +# mkdir -p /home/$USER/ISOs && sudo chown :kvm ~/ISOs \ No newline at end of file diff --git a/LMDE_SetupHome.sh b/LMDE_SetupHome.sh new file mode 100644 index 0000000..4683673 --- /dev/null +++ b/LMDE_SetupHome.sh @@ -0,0 +1,191 @@ +#!/bin/sh +# +if [ ! -f /etc/debian_version ]; then + echo "Unsupported Linux Distribution. Prepared for Debian" + exit 1 +fi +################################################################################ +# +# +# Setup Home Linux Mint / LMDE / Debian +# +# +################################################################################ +# +# Setup Dirs +rm -R /home/$USER/Dokumente +rm -R /home/$USER/Musik +rm -R /home/$USER/Videos +rm -R /home/$USER/Öffentlich +mkdir -p /home/$USER/Android +mkdir -p /home/$USER/Android/Backup-Android +mkdir -p /home/$USER/Android/Redmi_Note +mkdir -p /home/$USER/Android/Tablet +mkdir -p /home/$USER/Android/Teracube +mkdir -p /home/$USER/Applications +mkdir -p /home/$USER/Ansible +mkdir -p /home/$USER/Backup +mkdir -p /home/$USER/Backup/Software +mkdir -p /home/$USER/Backup/rotate +mkdir -p /home/$USER/GIT +mkdir -p /home/$USER/Games +mkdir -p /home/$USER/Games/Bottles +mkdir -p /home/$USER/Games/GOG +mkdir -p /home/$USER/Games/Lutris +mkdir -p /home/$USER/Games/Heroic +mkdir -p /home/$USER/MyStuff/MyGit +mkdir -p /home/$USER/MyStuff +mkdir -p /home/$USER/MyStuff/01Work +mkdir -p /home/$USER/MyStuff/02KeepassXC +mkdir -p /home/$USER/MyStuff/03CherryTree +mkdir -p /home/$USER/MyStuff/04CryptBox +mkdir -p /home/$USER/MyStuff/Dokumente +mkdir -p /home/$USER/MyStuff/Scripte +mkdir -p /home/$USER/MyStuff/Diba-Konto +mkdir -p /home/$USER/MyStuff/Mail-Archiv +mkdir -p /home/$USER/MyStuff/02KeepassXC +mkdir -p /home/$USER/MyStuff/PC+Netzwerk +mkdir -p /home/$USER/MyStuff/Paperwork +mkdir -p /home/$USER/ownCloud +mkdir -p /home/$USER/ownCloud/Arbeit +mkdir -p /home/$USER/ownCloud/FileDrop +mkdir -p /home/$USER/ownCloud/Upload +mkdir -p /home/$USER/Share-Cloud +mkdir -p /home/$USER/Share-Priv +mkdir -p /home/$USER/Share-SMB +mkdir -p /home/$USER/Share-VM +mkdir -p /home/$USER/Sync + +#ln -sf /home/$USER/MyStuff/Dokumente ~/Dokumente +#ln -sf /home/$USER/MyStuff/01Work /home/$USER/Schreibtisch/Work + +# Setup config aacs +mkdir -p /home/$USER/.config/aacs/ +cd /home/$USER/.config/aacs/ && wget --no-check-certificate http://vlc-bluray.whoknowsmy.name/files/KEYDB.cfg + + +cat > /home/$USER/.profile <<"EOF" +export GTK_THEME=Arc-Dark +EOF + + +## Hide the plank icon from plank: +gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/ show-dock-item false + +## Papierkorb automatisch leeren, wenn Inhalt älter als 3 Tage: +gsettings set org.gnome.desktop.privacy old-files-age "3" +gsettings set org.gnome.desktop.privacy remove-old-trash-files true + +## Maximales Alter der Daten im Thumbnail-Cache in Tagen: +gsettings set org.gnome.desktop.thumbnail-cache maximum-age 14 + +## Maximale Größe des Thumbnail-Caches in MB: +gsettings set org.gnome.desktop.thumbnail-cache maximum-size 256 + +# Setup ~/.fonts.conf +# This will enable subpixel-hinting and font-smoothing. +# Now just restart X.org (log out, then back in again). +# Read more here: +# https://wiki.debian.org/Fonts + +cat > /home/$USER/.fonts.conf <<"EOF" + + + + + + rgb + + + + + true + + + + + hintslight + + + + + true + + + + + lcddefault + + + +EOF + +cat > /home/$USER/.rsync-exclude <<"EOF" +- Downloads +- Games +- Share-Cloud +- Share-Priv +- Share-SMB +- Share-VM +- Sync +- VM-Image +- Code Cache +- cache* +- Cache* +- Cache_* +- *_cache +- *Cache +- DawnGraphiteCache +- log* +- logs +- tmp +- Trash ++ .config +- .config/syncthing +- .config/unity3d +- .config/ownCloud ++ .local +- .local/state +- .local/share/containers +- .local/share/flatpak +- .local/share/keyrings +- .local/share/nomic.ai +- .local/share/Steam ++ .jd2 ++ .conkyrc +- .* +- *.LOG +- LOG +- *.old +EOF + +cat > /home/$USER/.rsync-backup <<"EOF" +#!/bin/sh +# +################################################################################ +# +# Push Home Zulumann to Fileserver01/Backup/$HOSTNAME/ +# +################################################################################ +# -a (Kurzversion für --archive): gleiche Bedeutung wie -rlptgoD +# -r (Kurzversion für --recursive): Unterverzeichnisse kopieren +# -l (Kurzversion für --links): symbolische Links kopierenrsync +# -p (Kurzversion für --perms): Rechte der Quelldatei beibehalten +# -t (Kurzversion für --times): Zeiten der Quelldatei beibehalten +# -g (Kurzversion für --group): Gruppenrechte der Quelldatei beibehalten +# -o (Kurzversion für --owner): Besitzrechte der Quelldatei beibehalten (nur als root User möglich) +# -D (Kurzversion für --devices --specials): Gerätedateien der Quelldatei beibehalten (nur als root User möglich) +# -v (Kurzversion für --verbose): zeigt während der Ausführung an welche Dateien synchronisiert werden +# -z +# --delete: entfernt Dateien im Zielverzeichnis die mittelerweile im Quellverzeichnis nicht mehr vorhanden sind +# rsync --dry-run +################################################################################ +# rsync -rdt rsync://192.168.10.52/ +# +source=/home/$USER/ +destination=rsync://192.168.10.52:873/Backup/$HOSTNAME/ +exlude=/home/$USER/.rsync-exlude +output=/home/$USER/.rsync-backup.log +trash=01rsync-trash +rsync -a -v --exclude-from="${exlude}" --delete --progress --partial "${source}" "${destination}" -b --backup-dir="${trash}" 2>&1 | tee "${output}" +EOF \ No newline at end of file