LinuxMint/LinuxMint22_System.sh

1032 lines
29 KiB
Bash
Raw Normal View History

2024-12-29 18:21:40 +01:00
#!/bin/sh
#
if [ ! -f /etc/debian_version ]; then
echo "Unsupported Linux Distribution. Prepared for Debian"
exit 1
fi
################################################################################
#
#
# Linux Mint 21 System Install
#
#
################################################################################
#
while :
do
clear
echo ""
echo "\033[1m I N S T A L L Linux Mint 22"
echo " ----------------------------------"
echo "\033[0m"
echo "01.Remove Fonts+Software"
echo "02.Install System"
echo "03.Install TLP"
echo "04.Install XanMod-Kernel"
echo " ----------------------------------------"
echo "06.Install Samba"
echo "07.Install OpenSSH-Server"
echo " ----------------------------------------"
echo "08.Install Software"
echo "09.Install DVD+Bluray"
echo "13.Install HPLIP+Plugin"
echo "17.Install Timeshift-Autosnap-APT"
echo " ----------------------------------------"
echo "20.Install AMD-GPU"
echo "21.Install Radeon-GPU"
echo "22.Install Intel-GPU"
echo "23.Install Nvidia-GPU"
echo " ----------------------------------------"
echo "24.Setup Home"
echo "25.Disable ipv6"
echo "26.Cleanup System"
echo ""
echo " x. Exit"
echo ""
echo -n " Please enter option [01 - 26]"
read opt
case $opt in
##################################################################################
01) echo "************ Remove Fonts+Software **********************";
##################################################################################
sudo apt remove -y onboard transmission transmission-gtk rhythmbox
# Remove most Asian font:
# =======================
# If you're not a user of Asian fonts, you might remove a couple of those. That should free up several
# hundred MB's of disk space, but more importantly: the font selection box in Libre Office will become
# much less cluttered.
sudo apt remove -y fonts-kacst* fonts-khmeros* fonts-lklug-sinhala fonts-guru-extra fonts-nanum* fonts-noto-cjk
sudo apt remove -y fonts-takao* fonts-tibetan-machine fonts-lao fonts-sil-padauk fonts-sil-abyssinica fonts-tlwg-*
sudo apt remove -y fonts-lohit-* fonts-beng-extra fonts-gargi fonts-gubbi fonts-gujr-extra fonts-kalapi fonts-lohit-*
sudo apt remove -y fonts-samyak* fonts-navilu fonts-nakula fonts-orya-extra fonts-pagul fonts-sarai fonts-telu* fonts-wqy*
sudo apt remove -y fonts-smc* fonts-deva-extra
sudo dpkg-reconfigure fontconfig
## Disable SystemD Service
#sudo systemctl stop ModemManager && sudo systemctl disable ModemManager
;;
##################################################################################
02) echo "************ Install System **********************";
##################################################################################
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
wget \
software-properties-common
echo -e '\033[33m----Setup locales----\033[33m'
echo -e "\033[0m"
sleep 2
sudo dpkg-reconfigure locales && sudo update-locale LANG=de_DE.UTF-8 && sudo locale-gen --purge --no-archive && sudo update-initramfs -u -k all
echo -e '\033[33m------Reconfigure Timezone------\033[33m'
echo -e "\033[0m"
sleep 2
sudo dpkg-reconfigure tzdata
sudo timedatectl set-timezone Europe/Berlin
echo -e '\033[33m------Install Firmware & DKMS------\033[33m'
echo -e "\033[0m"
sleep 2
sudo apt install -y \
acpi \
acpid
echo -e '\033[33m----Setup FS-Tab----\033[33m'
echo -e "\033[0m"
sleep 2
sudo cp /etc/fstab /etc/fstab.default
#sudo sed -i 's/errors=remount-ro/noatime,commit=600,errors=remount-ro/g' /etc/fstab
sudo sed -i 's/defaults,subvol=@/defaults,noatime,compress=zstd,subvol=@/g' /etc/fstab
sudo sed -i 's/defaults/defaults,noatime/g' /etc/fstab
sudo sh -c 'echo "
# Secure shared memory
tmpfs /dev/shm tmpfs defaults,noexec,nosuid 0 0
# Tmpfs
tmpfs /var/tmp tmpfs defaults,noatime 0 0
tmpfs /var/spool tmpfs defaults,noatime 0 0
#tmpfs /var/lock tmpfs defaults 0 0
#tmpfs /var/cache/apt/archives tmpfs size=15%,defaults 0 0
" >> /etc/fstab'
sudo systemctl daemon-reload
echo -e '\033[33m----Setup rc.local / Systemd Service----\033[33m'
echo -e "\033[0m"
sleep 2
sudo bash -c 'cat << EOF > /etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
EOF'
sudo bash -c 'cat << EOF > /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#exit 0
EOF'
sudo sed -i 's/#exit 0/exit 0/g' /etc/rc.local
sudo chmod +x /etc/rc.local
sudo systemctl enable --now rc-local.service
## Tmp mount
sudo cp /usr/share/systemd/tmp.mount /etc/systemd/system/ && sudo systemctl enable --now tmp.mount
## Sytemd journald
sudo sh -c "echo 'SystemMaxUse=100M' >> /etc/systemd/journald.conf"
## fstrim timer
sudo systemctl enable --now fstrim.timer
## fstrim.service
sudo bash -c 'cat << EOF > /etc/systemd/system/fstrim.service
[Unit]
Description=Trim free cells on the SSD
After=local-fs.target
[Service]
ExecStart=/sbin/fstrim /
ExecStart=/sbin/fstrim /home
Type=oneshot
[Install]
WantedBy=multi-user.target
EOF'
sudo systemctl enable --now fstrim.service
echo -e '\033[33m----Setup Cron----\033[33m'
echo -e "\033[0m"
sleep 2
sudo cp /etc/crontab /etc/crontab.default
sudo sh -c "echo '@weekly root apt autoremove && apt clean' >> /etc/crontab"
echo -e '\033[33m----Setup Grub----\033[33m'
echo -e "\033[0m"
sleep 2
sudo cp /etc/default/grub /etc/default/grub.default
sudo sed -i 's/#GRUB_GFXMODE=640x480/GRUB_GFXMODE=1920x1080x32/g' /etc/default/grub
sudo update-grub
echo -e '\033[33m----Install Fonts / Optimise Bitmap-Fonts----\033[33m'
echo -e "\033[0m"
sleep 2
sudo apt install -y \
fonts-terminus \
fonts-noto \
fonts-entypo \
xfonts-75dpi \
xfonts-100dpi \
xfonts-terminus \
ttf-mscorefonts-installer
sudo bash -c 'cat << EOF > /etc/fonts/conf.avail/20-no-embedded.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
</fontconfig>
EOF'
sudo ln -s /etc/fonts/conf.avail/20-no-embedded.conf /etc/fonts/conf.d/
echo -e '\033[33m----Install log2ram----\033[33m'
echo -e "\033[0m"
sleep 2
curl -Lo log2ram.tar.gz https://github.com/azlux/log2ram/archive/master.tar.gz && tar xf log2ram.tar.gz
cd log2ram-master && chmod +x install.sh && sudo ./install.sh
sudo sed -i "s/SIZE=128M/SIZE=300M/g" /etc/log2ram.conf
sudo systemctl restart log2ram
echo -e '\033[33m----Install zramswap----\033[33m'
echo -e "\033[0m"
sleep 2
sudo swapoff --all && free
sudo apt install zram-tools && sudo zramswap stop
sudo mv /etc/default/zramswap /etc/default/zramswap.default
sudo bash -c 'cat << EOF > /etc/default/zramswap
# Compression algorithm selection
# speed: lz4 > zstd > lzo
# compression: zstd > lzo > lz4
# This is not inclusive of all that is available in latest kernels
# See /sys/block/zram0/comp_algorithm (when zram module is loaded) to see
# what is currently set and available for your kernel[1]
# [1] https://github.com/torvalds/linux/blob/master/Documentation/blockdev/zram.txt#L86
ALGO=lz4
# Specifies the amount of RAM that should be used for zram
# based on a percentage the total amount of available memory
# This takes precedence and overrides SIZE below
#PERCENT=50
# Specifies a static amount of RAM that should be used for
# the ZRAM devices, this is in MiB
SIZE=1024
# Specifies the priority for the swap devices, see swapon(2)
# for more details. Higher number = higher priority
# This should probably be higher than hdd/ssd swaps.
PRIORITY=100
EOF'
sudo zramswap start
# cat /proc/swaps
echo -e '\033[33m----Setup Themes----\033[33m'
echo -e "\033[0m"
sudo apt install -y qt5-style-plugins
sudo sh -c 'echo "export QT_QPA_PLATFORMTHEME=gtk2" >> /etc/environment'
echo -e '\033[33m----Enable UFW Firewall----\033[33m'
echo -e "\033[0m"
sleep 2
sudo ufw allow 5353 # MDNS
sudo ufw enable
;;
##################################################################################
03) echo "************ Install TLP **********************";
##################################################################################
sudo apt install -y \
tlp \
tlp-rdw
# Auf ThinkPads installiert man zusätzlich:
# sudo apt install -y tp-smapi-dkms acpi-call-dkms
;;
##################################################################################
04) echo "************ Install XanMod-Kernel **********************";
##################################################################################
wget -qO - https://dl.xanmod.org/archive.key | sudo gpg --dearmor -vo /usr/share/keyrings/xanmod-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/xanmod-archive-keyring.gpg] http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-release.list
sudo apt update && sudo apt install -y linux-xanmod-x64v3
# Installieren Sie XanMod edge (empfohlen für den neuesten Kernel):
# sudo apt update && sudo apt install linux-xanmod-edge
# XanMod Stable entfernen:
# sudo apt autoremove linux-xanmod --purge -y
# XanMod-Kante entfernen:
# sudo apt autoremove linux-xanmod-edge --purge -y
# Repository entfernen:
# sudo rm /etc/apt/sources.list.d/xanmod-kernel.list
;;
##################################################################################
07) echo "************ Install Samba **********************";
##################################################################################
sudo apt install -y \
samba
# Change the owner of the directory to root and the group to sambashare:
sudo chown -R root:sambashare /var/lib/samba/usershares
# Change the permissions of the usershares directory so that users in the group sambashare can create files.
# This command also sets sticky bit, which is important to prevent users from deleting usershares of other users:
#sudo chmod 1770 /var/lib/samba/usershares
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.default
sudo bash -c 'cat << EOF > /etc/samba/smb.conf
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
workgroup = WORKGROUP
server string = %h server
disable netbios = yes
unix extensions = yes
client min protocol = SMB2
client max protocol = SMB3
server min protocol = SMB2
server max protocol = SMB3
# protocol = SMB3
wide links = no
follow symlinks = no
create mask = 0777
directory mask = 0777
####### Authentication #######
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
invalid users = root
map to guest = bad user
guest account = nobody
guest ok = yes
usershare path = /var/lib/samba/usershares
usershare max shares = 100
usershare allow guests = yes
usershare owner only = false
####### Tuning #######
socket options = TCP_NODELAY IPTOS_LOWDELAY
use sendfile = no
getwd cache = yes
stat cache = yes
min receivefile size = 16384
write raw = yes
read raw = yes
max xmit = 32768
deadtime = 15
keepalive = 150
sync always = no
large readwrite = yes
strict sync = no
strict allocate = Yes
strict locking = no
server multi channel support = yes
aio write size = 1
aio read size = 1
#### Networking ####
;interfaces = 127.0.0.0/8 enp37s0
;bind interfaces only = yes
;hosts allow = 127.0.0.0/8 192.168.10.0/24 192.168.70.0/24
;hosts deny = all
### Browsing election options ###
time server = no
wins support = no
multicast dns register = no
#dns forwarder = 192.168.10.1
dns proxy = yes
#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
logging = syslog
panic action = /usr/share/samba/panic-action %d
passdb backend = tdbsam
obey pam restrictions = no
log level = 0
####### Pinter #######
load printers = no
disable spoolss = yes
printing = bsd
printcap name = /dev/null
#======================= Share Definitions =======================
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
;write list = root, @lpadmin
EOF'
sudo bash -c 'cat << EOF > /etc/avahi/services/smb.service
<?xml version="1.0" standalone="no"?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h - SMB/CIFS</name>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
</service-group>
EOF'
sudo systemctl restart smbd.service
sudo systemctl restart nmbd.service
sudo systemctl restart avahi-daemon.service
sudo ufw allow samba
sudo ufw reload
# sudo usermod -aG sambashare $USER
sudo gpasswd sambashare -a $USER
sudo smbpasswd -a $USER
# sudo apt install -y wsdd
# sudo ufw allow 3702/udp # wsdd
# sudo ufw allow 5357/tcp # wsdd
# sudo ufw reload
;;
##################################################################################
09) echo "************ Install OpenSSH-Server **********************";
##################################################################################
sudo addgroup sshusers
sudo usermod -aG sshusers $USER
sudo apt install -y openssh-server openssh-client
sudo mv /etc/ssh/sshd_config /etc/ssh/sshd_config.default
sudo bash -c 'cat << EOF > /etc/ssh/sshd_config
Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
DenyUsers root
DenyGroups root
AllowGroups sshusers
LoginGraceTime 600
PermitRootLogin no
#StrictModes yes
MaxAuthTries 3
#MaxSessions 10
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# enable PAM authentication
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
ClientAliveInterval 1200
ClientAliveCountMax 3
#UseDNS no
PidFile /var/run/sshd.pid
MaxStartups 32
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
EOF'
sudo systemctl restart ssh.service
sudo sh -c 'echo "sshd: ALL EXCEPT LOCAL" >> /etc/hosts.deny'
sudo sh -c 'echo "sshd: 192.168.10.0/255.255.255.0" >> /etc/hosts.allow'
sudo apt install -y fail2ban
sudo bash -c 'cat << EOF > /etc/fail2ban/jail.local
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
findtime = 300
bantime = 3600
ignoreip = 127.0.0.1 ::1
EOF'
sudo systemctl restart fail2ban.service
sudo ufw allow ssh # Openssh-Server
sudo ufw reload
# Monitoring With Fail2Ban-Client:
# sudo fail2ban-client status
# sudo fail2ban-client status sshd
;;
##################################################################################
11) echo "************ Install Software **********************";
##################################################################################
echo -e '\033[33m------Install COMMONLY USED APPLICATIONS------\033[33m'
echo -e "\033[0m"
sudo apt install -y \
bmon \
clang llvm \
conky-all \
fuseiso \
git \
localepurge \
haveged \
htop iotop iftop powertop atop \
tmux \
numlockx \
screenfetch \
screen \
saidar \
dfc \
mc \
md5deep \
mtp-tools \
ncdu \
pwgen \
ppa-purge \
preload \
renameutils \
unrar unace p7zip-rar sharutils rar arj lunzip lzip
#apt install -y smartmontools glances hddtemp gpm
echo -e '\033[33m----Accessory Applications----\033[33m'
echo -e "\033[0m"
sudo apt install -y \
doublecmd-gtk \
diodon \
gtkhash \
keepassxc \
shutter \
plank \
cherrytree
# caffeine \
echo -e '\033[33m----Grafik Applications----\033[33m'
echo -e "\033[0m"
sleep 2
sudo apt install -y \
gimp gimp-gap gimp-gutenprint gimp-plugin-registry gimp-help-de \
flameshot \
pinta
echo -e '\033[33m------Install Codec------\033[33m'
echo -e "\033[0m"
sudo apt install -y \
faac \
faad \
flac \
flvstreamer \
ffmpeg \
gstreamer1.0-x \
gstreamer1.0-tools \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-pulseaudio \
gstreamer1.0-plugins-ugly \
lame \
libquicktime2 \
libasound2-plugins-extra \
mppenc \
mint-meta-codecs \
vorbis-tools vorbisgain \
ogmtools \
opus-tools \
wavpack \
x264 \
x265
echo -e '\033[33m----Multimedia Applications----\033[33m'
echo -e "\033[0m"
sudo apt install -y \
audacious \
easytag \
mediainfo mediainfo-gui \
mpv \
pavucontrol \
soundconverter \
vlc vlc-plugin-samba
# puddletag python-musicbrainz2 libchromaprint-tools
echo -e '\033[33m----Internet Applications----\033[33m'
echo -e "\033[0m"
sudo apt install -y \
filezilla \
firejail \
uget \
mailnag \
remmina \
remmina-plugin-rdp \
remmina-plugin-secret \
remmina-plugin-spice
#quiterss \
#deluge-gtk \
echo -e '\033[33m----Office Applications----\033[33m'
echo -e "\033[0m"
sudo apt install -y \
evolution \
meld \
libreoffice-evolution \
pdfarranger \
xchm
echo -e '\033[33m------Install Nemo Addons------\033[33m'
echo -e "\033[0m"
sudo apt install -y \
nemo-compare \
nemo-gtkhash \
nemo-fileroller \
nemo-media-columns \
nemo-share \
nemo-seahorse
echo -e '\033[33m----System Applications----\033[33m'
echo -e "\033[0m"
sudo apt install -y \
backintime-qt \
bleachbit \
gparted \
gsmartcontrol \
hardinfo \
tilda \
notify-osd \
libnotify-bin
echo -e '\033[33m------Install Themes------\033[33m'
echo -e "\033[0m"
sudo apt install -y \
chameleon-cursor-theme
ln -s /etc/alternatives/x-cursor-theme /usr/share/icons/default/index.theme
sudo update-alternatives --config x-cursor-theme
echo -e '\033[33m------Install Profile-Sync-Daemon------\033[33m'
echo -e "\033[0m"
sudo apt install -y profile-sync-daemon
# Enable and start psd service:
systemctl --user enable psd && systemctl --user start psd
cp -r /home/$USER/.mozilla /home/$USER/.mozilla.backup
mv /home/$USER/.config/psd/psd.conf /home/$USER/.config/psd/psd.conf.default
cat > ~/.config/psd/psd.conf <<"EOF"
## NOTE the following:
## To protect data from corruption, in the event that you do make an edit while
## psd is active, any changes made will be applied the next time you start psd.
# Uncomment and set to "yes" to use overlayfs instead of a full copy to reduce
# the memory costs and to improve sync/unsync operations. Note that your kernel
# MUST have this module available in order to use this mode
#
USE_OVERLAYFS="yes"
# List browsers separated by spaces to include in the sync. Useful if you do not
# wish to have all possible browser profiles sync'ed which is the default if
# this variable is left commented.
#
BROWSERS="firefox"
# Uncomment and set to "no" to completely disable the crash recovery feature.
#
# The default is to create crash recovery backups if the system is ungracefully
# powered-down due to a kernel panic, hitting the reset switch, battery going
# dead, etc. Some users keep very diligent backups and don't care to have this
# feature enabled.
USE_BACKUPS="yes"
EOF
sudo sh -c "echo '$USER ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper' >> /etc/sudoers"
# Restart psd service:
systemctl --user restart psd
# Preview the Profile-sync-daemon settings
# You can preview what exactly Psd is doing by passing the option -p
# psd p
# Change sync intervals
# By default, Profile-sync-daemon runs every one hour
#crontab -e
#*/15 * * * * /usr/bin/profile-sync-daemon sync &> /dev/null
;;
##################################################################################
13) echo "************ Install DVD+Bluray **********************";
##################################################################################
sudo apt install -y \
asunder \
libaacs0 \
libbluray-bdj \
libdvdcss2
# 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
;;
##################################################################################
13) echo "************ Install HPLIP+Plugin **********************";
##################################################################################
sudo apt install --assume-yes \
printer-driver-cups-pdf \
hplip \
hplip-gui
# Download and Install HPLIP-Plugin:
mkdir -p ~/.install/ && cd ~/.install/
wget https://developers.hp.com/sites/default/files/hplip-3.23.12-plugin.run
chmod u+x hplip*.run && sh hplip*.run
sleep 10
sudo ufw allow 515 # LPD (Printer)
sudo ufw allow 427 # IPP (Printer) / SLP (Printer scanner)
sudo ufw reload
;;
##################################################################################
17) echo "************ Install Timeshift-Autosnap-APT **********************";
##################################################################################
sudo apt install -y btrfs-progs
mkdir -p /home/$USER/.install/
git clone https://github.com/wmutschl/timeshift-autosnap-apt.git /home/$USER/.install/timeshift-autosnap-apt
cd /home/$USER/.install/timeshift-autosnap-apt
sudo make install
git clone https://github.com/Antynea/grub-btrfs.git /home/$USER/.install/grub-btrfs
cd /home/$USER/.install/grub-btrfs
sudo make install
# For example, as we do not have a dedicated /boot partition, we can set snapshotBoot=false
# in the timeshift-autosnap-apt-conf file to not rsync
# the /boot directory to /boot.backup. Note that the EFI partition is still rsynced into your
# snapshot to /boot.backup/efi. For grub-btrfs,
sudo cp /etc/timeshift-autosnap-apt.conf /etc/timeshift-autosnap-apt.conf.default
sudo sed -i 's/snapshotBoot=true/snapshotBoot=false/g' /etc/timeshift-autosnap-apt.conf
# I change GRUB_BTRFS_SUBMENUNAME to “My BTRFS Snapshots”.
sudo cp /etc/default/grub-btrfs/config /etc/default/grub-btrfs/config.default
sudo sed -i 's/#GRUB_BTRFS_SUBMENUNAME="Arch Linux snapshots"/GRUB_BTRFS_SUBMENUNAME="My BTRFS Snapshots"/g' /etc/default/grub-btrfs/config
# Check if everything is working:
sudo timeshift-autosnap-apt
;;
##################################################################################
20) echo "************ Install AMD-GPU **********************";
##################################################################################
sudo apt install -y \
libglx-mesa0 \
libglx-mesa0:i386 \
libgl1-mesa-dri \
libgl1-mesa-dri:i386 \
mesa-vulkan-drivers \
mesa-vulkan-drivers:i386 \
mesa-va-drivers \
mesa-va-drivers:i386 \
libvulkan-dev \
libvulkan-dev:i386 \
mesa-utils \
vulkan-tools \
mesa-common-dev \
mesa-vdpau-drivers \
mesa-vdpau-drivers:i386 \
vkbasalt \
vdpau-driver-all \
libvdpau-va-gl1 \
vdpauinfo \
vainfo
sudo bash -c 'cat << EOF > /etc/X11/xorg.conf.d/20-amdgpu.conf
Section "Device"
Identifier "AMD"
Driver "amdgpu"
Option "TearFree" "true"
Option "DRI" "3"
EndSection
EOF'
sudo cp /etc/environment /etc/environment.default &&
echo -e "ENABLE_VKBASALT=1" | sudo tee -a /etc/environment &&
echo -e "RADV_PERFTEST=aco,sam,nggc" | sudo tee -a /etc/environment &&
echo -e "mesa_glthread=true" | sudo tee -a /etc/environment
# echo "export ENABLE_VKBASALT=1" >> ~/.profile
# echo "export RADV_PERFTEST=aco" >> ~/.profile
# echo "export mesa_glthread=true" >> ~/.profile
;;
##################################################################################
21) echo "************ Install Radeon-GPU **********************";
##################################################################################
sudo bash -c 'cat << EOF > /etc/X11/xorg.conf.d/20-radeon.conf
Section "Device"
Identifier "Radeon"
Driver "radeon"
Option "TearFree" "true"
Option "DRI" "3"
EndSection
EOF'
;;
##################################################################################
22) echo "************ Install Intel-GPU **********************";
##################################################################################
sudo bash -c 'cat << EOF > /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
Option "AccelMethod" "uxa"
Option "TripleBuffer" "true"
EndSection
EOF'
;;
##################################################################################
23) echo "************ Install Nvidia-GPU **********************";
##################################################################################
;;
##################################################################################
24) echo "************ Setup Home **********************";
##################################################################################
# Setup compose-cache
mkdir /home/$USER/.compose-cache/ && ln -sfv /run/user/$UID/ /home/$USER/.compose-cache
# 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/bin
mkdir -p /home/$USER/Backup
mkdir -p /home/$USER/Backup/rotate
mkdir -p /home/$USER/GIT
mkdir -p /home/$USER/Sync
mkdir -p /home/$USER/Share
mkdir -p /home/$USER/MyStuff
mkdir -p /home/$USER/MyStuff/Dokumente
mkdir -p /home/$USER/MyStuff/Script
ln -sf /home/$USER/MyStuff/Dokumente ~/Dokumente
ln -sf /home/$USER/MyStuff/Script ~/Script
## 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"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
</fontconfig>
EOF
;;
##################################################################################
25) echo "************ Disable ipv6 **********************";
##################################################################################
sudo bash -c 'cat << EOF > /etc/sysctl.d/70-disable-ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
EOF'
sudo sysctl -p -f /etc/sysctl.d/70-disable-ipv6.conf
#Remove IPv6 hosts:
sudo sed -i '/::/s%^%#%g' /etc/hosts
;;
##################################################################################
26) echo "************ Cleanup System **********************";
##################################################################################
# du -sh /var/cache/apt/archives
sudo apt clean && sudo apt autoremove && sudo apt autoremove --purge
# Check the size of your systems thumbnail before deleting them using the command:
#du -sh ~/.cache/thumbnails
sudo rm -rf ~/.cache/thumbnails/*
sudo rm -rf ~/.local/share/Trash/*
# sudo rm -rf /root/.local/share/Trash/*
# Paketlisten aufräumen:
# Im Laufe der Zeit kann es passieren, dass sich in /var/lib/apt/lists/ eine Menge an Listen ansammelt. Nicht alle davon werden benötigt.
sudo rm -rf /var/lib/apt/lists/* && sudo apt update
;;
x) echo "";
exit 1;;
*) echo " Press [enter] key to continue. . .";
read enterKey;;
esac
done