echo" systemd-boot: /boot/loader/entries/*.conf, append to end of line beginning with \"options\""
echo" grub: /etc/default/grub"
echo""
echo" run this script with the --harden flag again after rebooting to ensure all settings are applied correctly."
echo" press enter to continue."
read input
#add any firejail configuration here
#fix mpv not being able to open some files, allows mmpv to play videos in the ~/media dir
sudo sh -c 'echo "whitelist $HOME/media" >> /etc/firejail/whitelist-player-common.local'
}
configure(){
#setup home directories
mkdir ~/docs/
mkdir ~/dl/
mkdir ~/media/
mkdir -p ~/.local/share/gnupg/
mkdir -p ~/.config/mpd/playlists
mkdir -p ~/.local/share/desktop
mkdir -p ~/.local/share/wineprefixes/default
mkdir .local/share/public
mkdir .local/share/templates
mkdir media/audio
mkdir media/video
#setup ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow http
sudo ufw allow https
#sudo ufw allow ssh
sudo ufw allow ntp
sudo ufw allow 67:68/tcp
sudo ufw allow 53
#allow torrent client traffic
sudo ufw allow 56881:56889/tcp
#rules to allow steam
sudo ufw allow 27000:27036/udp
sudo ufw allow 27036:27037/tcp
sudo ufw allow 4380/udp
sudo ufw enable
#install zsh shell
chsh -s /bin/zsh "$USER"
#setup .zprofile and zsh history file
cd ~ ||return
ln -s ~/.profile ~/.zprofile
mkdir -p ~/.cache/zsh
touch ~/.cache/zsh/history
#replace sudo with doas
echo"installing doas, symlinking to sudo, and UNINSTALLING SUDO. sudo is uninstalled using doas so permissions should be setup right if you are able to uninstall. (y/N)"
read input
if["$input"="y"];then
echo"permit persist $USER as root" > ~/.cache/doas.conf
echo"permit nopass :wheel as root cmd /sbin/poweroff" >> ~/.cache/doas.conf
echo"permit nopass :wheel as root cmd /sbin/reboot" >> ~/.cache/doas.conf
sudo cp ~/.cache/doas.conf /etc/doas.conf
rm ~/.cache/doas.conf
doas pacman -R sudo #&& doas ln -s /bin/doas /bin/sudo #TODO ARCH SPECIFIC
fi
#set limits for esync
sudo sh -c "echo '$USER hard nofile 524288' >> /etc/security/limits.conf"
#set limits for monero
sudo sh -c "echo '$USER hard memlock 2048' >> /etc/security/limits.conf"
sudo sh -c "echo '$USER hard memlock 2048' >> /etc/security/limits.conf"
#fix issue with arduino ide and tiling wms
sudo sh -c 'echo "export _JAVA_AWT_WM_NONREPARENTING=1" >> /etc/profile.d/jre.sh'
#set console terminal font
sudo sh -c 'echo "FONT=Lat2-Terminus16" >> /etc/vconsole.conf'
#set grub theme
#sudo sed -i 's/#GRUB_COLOR_NORMAL/GRUB_COLOR_NORMAL/g' /etc/default/grub
#sudo sed -i 's/#GRUB_COLOR_HIGHLIGHT/GRUB_COLOR_HIGHLIGHT/g' /etc/default/grub