preseed installdxt3

#!/bin/bash

_user="$(id 1000 -u -n)"

cd /root/debs
apt install -y ./*.deb

rm /usr/share/applications/exo-mail-reader.desktop
rm /usr/share/applications/exo-terminal-emulator.desktop
rm /usr/share/applications/exo-web-browser.desktop
rm /usr/share/applications/thunar-bulk-rename.desktop
rm /usr/share/applications/vim.desktop
rm /usr/share/applications/thunar.desktop
rm /usr/share/applications/display-im6.q16.desktop
rm /usr/share/applications/compton.desktop
rm /usr/share/applications/libreoffice-startcenter.desktop
rm /usr/share/applications/conky.desktop

rm -r /usr/share/icons/Adwaita
rm -r /usr/share/themes/Adwaita
rm -r /usr/share/themes/Adwaita-dark
rm -r /usr/share/themes/Bright
rm -r /usr/share/themes/Daloa
rm -r /usr/share/themes/Emacs
rm -r /usr/share/themes/Kokodi
rm -r /usr/share/themes/Moheli
rm -r /usr/share/themes/Raleigh
rm -r /usr/share/themes/Retro
rm -r /usr/share/themes/Smoke
rm -r /usr/share/themes/ZOMG-PONIES!

7z x -aoa /root/share.7z -o/usr/share
7z x -aoa /root/skel.7z -o/etc/skel
7z x -aoa /root/skel.7z -o/home/$_user
7z x -aoa /root/skel.7z -o/root

sed -i "s/#autologin-user=/autologin-user=$_user/g" /etc/lightdm/lightdm.conf
echo "export PATH="/usr/share/dxt3:$PATH"" >> /root/.bashrc
cp /home/$_user/.local/share/hotcorners/lwa-hot-corners /usr/bin
chmod +x /usr/bin/lwa-hot-corners

chown $_user:$_user -R /home/$_user
chown root:root -R /root
chown root:root -R /etc/skel

cat << EOF > /etc/sysctl.d/dxt3sysctl.conf
fs.file-max = 2097152
net.core.netdev_max_backlog = 65536
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_messages = 1
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_timestamps = 0
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
vm.dirty_background_bytes = 16777216
vm.dirty_background_ratio = 2
vm.dirty_bytes = 50331648
vm.dirty_ratio = 60
vm.vfs_cache_pressure = 60
vm.swappiness = 10
EOF

cat << EOF > /etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
background = /usr/share/backgrounds/owl.jpg
EOF

chsh -s /bin/bash root
chsh -s /bin/bash $_user

echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
sed -i "s/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g" /etc/default/grub
sed -i "s/ENABLED=no/ENABLED=yes/g" /etc/ufw/ufw.conf

/usr/share/dxt3/dxt3grub
/usr/share/dxt3/installtmp
sh /usr/share/dxt3/grub-shusher/grub-shusher.sh /dev/sda
echo "client max protocol = NT1" >> /etc/samba/smb.conf

adduser $_user lpadmin
adduser $_user sambashare

find /usr/share/locale -mindepth 1 -maxdepth 1 ! -name 'en*' -exec rm -r {} ;
rm -r /usr/share/doc/*
rm -r /usr/share/help/*

xdg-mime default transmission-gtk.desktop x-scheme-handler/magnet
echo "OPTIONS="-l /dev/null"" >> /etc/default/preload

echo "deb https://deb.debian.org/debian/ bullseye main contrib non-free" > /etc/apt/sources.list
cat << EOF > /etc/apt/apt.conf
Acquire::By-Hash "1";
Acquire::ForceIPv4 "1";
EOF

rm -r /root/debs
rm /root/installdxt3
rm /root/TRANS.TBL
rm /root/*.7z
sync