diff --git a/10-gaming-setup.sh b/10-gaming-setup.sh old mode 100755 new mode 100644 index fadeeee58..0e89d1e16 --- a/10-gaming-setup.sh +++ b/10-gaming-setup.sh @@ -21,6 +21,14 @@ PKGS=( 'earlyoom' 'ananicy-git' 'libva-vdpau-driver' +'pipewire' +'pipewire-pulse' +'pipewire-alsa' +'freetype2-cleartype' +'chromium-vaapi-bin' +'discord' +'gopreload-git' +'systemd-boot-pacman-hook' ) sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com @@ -29,7 +37,8 @@ sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.ta echo "[chaotic-aur] Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf - +$nvidia = false +$amd = false cd /home/$(whoami)/Documents/ mkdir temp @@ -37,12 +46,12 @@ mkdir temp pacman -Syy --noconfirm PS3='Please enter your GPU choice: ' -options=("Nvidia-tkg" "AMDGPU" "Quit") +options=("Nvidia" "AMDGPU" "Intel") select opt in "${options[@]}" do case $opt in - "Nvidia-tkg") - echo "You chose Nvidia-tkg" + "Nvidia") + echo "You chose Nvidia" $nvidia = true git clone https://github.com/Frogging-Family/nvidia-all.git cd nvidia-all @@ -50,10 +59,11 @@ do ;; "AMDGPU") echo "You chose AMDGPU" - pacman -S xf86-video-amdgpu --noconfirm --needed + $amd = true + pacman -S xf86-video-amdgpu amd-ucode --noconfirm --needed ;; - "Continue"|"Q"|"Quit"|*) - break + "Intel") + pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel intel-ucode libva-intel-driver libva-utils --needed --noconfirm ;; *) echo "invalid option $REPLY";; esac @@ -64,12 +74,49 @@ for PKG in "${PKGS[@]}"; do sudo pacman -S "$PKG" --noconfirm --needed done +sudo cat < /etc/pacman.d/hooks/100-systemd-boot.hook +[Trigger] +Type = Package +Operation = Upgrade +Target = systemd + +[Action] +Description = Updating systemd-boot +When = PostTransaction +Exec = /usr/bin/bootctl update +EOF + +#------------------------------------------------------------------------- +# Secure Boot Version +#sudo cat < /etc/pacman.d/hooks/99-secureboot.hook +#[Trigger] +#Operation = Install +#Operation = Upgrade +#Type = Package +#Target = linux +#Target = systemd + +#[Action] +#Description = Signing Kernel for SecureBoot +#When = PostTransaction +#Exec = /usr/bin/find /boot -type f ( -name vmlinuz-* -o -name systemd* ) -exec /usr/bin/sh -c 'if ! /usr/bin/sbverify --list {} 2>/dev/null | /usr/bin/grep -q "signature certificates"; then /usr/bin/sbsign --key db.key --cert db.crt --output "$1" "$1"; fi' _ {} ; +#Depends = sbsigntools +#Depends = findutils +#Depends = grep +#EOF + +pacman -S noto-fonts noto-fonts-cjk ttf-dejavu ttf-liberation ttf-opensans ttf-roboto ttf-roboto-mono ttf-ubuntu-font-family ttf-joypixels --noconfirm --needed +ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d +ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d +ln -s /etc/fonts/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d + echo -e "\nInstalling Base System Complete\n" echo -e "\nEnableing Services and Tweaking\n" systemctl --user enable gamemoded && systemctl --user start gamemoded systemctl enable --now earlyoom +systemctl --user enable pipewire pipewire-pulse #if($nvidia == true) then # nvidia-xconfig @@ -84,38 +131,97 @@ systemctl enable --now earlyoom #cd performance-tweaks #makepkg -si --noconfirm -sudo sysctl -w net.core.netdev_max_backlog = 16384 -sudo sysctl -w net.core.somaxconn = 8192 -sudo sysctl -w net.core.rmem_default = 1048576 -sudo sysctl -w net.core.rmem_max = 16777216 -sudo sysctl -w net.core.wmem_default = 1048576 -sudo sysctl -w net.core.wmem_max = 16777216 -sudo sysctl -w net.core.optmem_max = 65536 -sudo sysctl -w net.ipv4.tcp_rmem = 4096 1048576 2097152 -sudo sysctl -w net.ipv4.tcp_wmem = 4096 65536 16777216 -sudo sysctl -w net.ipv4.udp_rmem_min = 8192 -sudo sysctl -w net.ipv4.udp_wmem_min = 8192 -sudo sysctl -w net.ipv4.tcp_fastopen = 3 -sudo sysctl -w net.ipv4.tcp_max_syn_backlog = 8192 -sudo sysctl -w net.ipv4.tcp_max_tw_buckets = 2000000 -sudo sysctl -w vm.swappiness = 10 - -sudo cat <> /etc/pacman.d/hooks/nvidia.hook -[Trigger] -Operation=Install -Operation=Upgrade -Operation=Remove -Type=Package -Target=nvidia +# We want to set them every boot! Thats why we need to make a File thats launched on boot! -[Action] -Depends=mkinitcpio -When=PostTransaction -Exec=/usr/bin/mkinitcpio -P +touch /etc/init.d/titusscript + +sudo cat <> /etc/init.d/titusscript +#!/bin/bash +sysctl -w net.core.netdev_max_backlog = 16384 +sysctl -w net.core.somaxconn = 8192 +sysctl -w net.core.rmem_default = 1048576 +sysctl -w net.core.rmem_max = 16777216 +sysctl -w net.core.wmem_default = 1048576 +sysctl -w net.core.wmem_max = 16777216 +sysctl -w net.core.optmem_max = 65536 +sysctl -w net.ipv4.tcp_rmem = 4096 1048576 2097152 +sysctl -w net.ipv4.tcp_wmem = 4096 65536 16777216 +sysctl -w net.ipv4.udp_rmem_min = 8192 +sysctl -w net.ipv4.udp_wmem_min = 8192 +sysctl -w net.ipv4.tcp_fastopen = 3 +sysctl -w net.ipv4.tcp_max_syn_backlog = 8192 +sysctl -w net.ipv4.tcp_max_tw_buckets = 2000000 +EOF +chmod +x /etc/init.d/titusscript +update-rc titusscript defaults 40 1 + +sudo cat <> /etc/sysctl.d/99-swappiness.conf +vm.swappiness=10 +EOF + +if $amd == true; then + sudo cat <> /etc/X11/xorg.conf.d/99-amdgpu.conf +Section "Device" + Identifier "AMD" + Driver "amdgpu" + Option "TearFree" "true" +EndSection +EOF + +sudo cat <> /etc/X11/xorg.conf.d/99-amdgpu.conf +Section "Device" + Identifier "AMD" + Driver "amdgpu" + Option "TearFree" "true" + Option "VariableRefresh" "true" +EndSection +EOF + sudo cat <> /etc/mkinitcpio.conf + MODULES=(amdgpu) +EOF +fi + +if $nvidia == true; then + sudo cat <> /etc/pacman.d/hooks/nvidia.hook + [Trigger] + Operation=Install + Operation=Upgrade + Operation=Remove + Type=Package + Target=nvidia + + [Action] + Depends=mkinitcpio + When=PostTransaction + Exec=/usr/bin/mkinitcpio -P +EOF + sudo cat <> /etc/mkinitcpio.conf + MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) +EOF +fi + +echo "AMD or Intel?" +select yn in "AMD" "Intel" +case $yn in + AMD ) + sudo cat <> /boot/loader/entries/arch.conf + initrd /amd-ucode.img +EOF ;; + Intel ) + sudo cat <> /boot/loader/entries/arch.conf + initrd /intel-ucode.img +EOF;; +esac + +sudo cat <> /boot/loader/entries/arch.conf +initrd /intel-ucode.img EOF +sudo cat <> /etc/sysctl.d/99-sysctl.conf +kernel.sysrq=1 +EOF -cat <> /home/$(whoami)/.config/mpv/mpv.conf +sudo cat <> /home/$(whoami)/.config/mpv/mpv.conf vo=vdpau profile=opengl-hq hwdec=vdpau @@ -130,16 +236,276 @@ sudo systemctl enable fstrim.timer sudo systemctl enable --now ananicy sudo mkinitcpio -p linux +# Performance by preloading +## SRC https://en.wikipedia.org/wiki/Preload_(software) +## https://wiki.archlinux.org/title/Preload + +chown -R $(whoami):$(whoami) /usr/share/gopreload/enabled /usr/share/gopreload/disabled + +# Fixing Fonts and shit + +## Enables Emojie Rendering + +sudo rm /etc/fonts/conf.d/75-joypixels.conf + +sudo cat <> /etc/fonts/conf.d/75-joypixels.conf + + + + + + + + + + emoji + JoyPixels + + + + + sans + JoyPixels + + + + serif + JoyPixels + + + + sans-serif + JoyPixels + + + + monospace + JoyPixels + + + + + + DejaVu + + + + charset + + + 0x1f600 + 0x1f640 + + + + + + + + + EmojiOne + JoyPixels + + + + Emoji One + JoyPixels + + + + EmojiOne Color + JoyPixels + + + + EmojiOne Mozilla + JoyPixels + + + + + Apple Color Emoji + JoyPixels + + + + Segoe UI Emoji + JoyPixels + + + + Segoe UI Symbol + JoyPixels + + + + Noto Color Emoji + JoyPixels + + + + NotoColorEmoji + JoyPixels + + + + Android Emoji + JoyPixels + + + + Noto Emoji + JoyPixels + + + + Twitter Color Emoji + JoyPixels + + + + Twemoji + JoyPixels + + + + Twemoji Mozilla + JoyPixels + + + + TwemojiMozilla + JoyPixels + + + + EmojiTwo + JoyPixels + + + + Emoji Two + JoyPixels + + + + EmojiSymbols + JoyPixels + + + + Symbola + JoyPixels + + +EOF + +cat <> /etc/profile.d/freetype2.sh +export FREETYPE_PROPERTIES="truetype:interpreter-version=40" +EOF + +touch ~/.config/fontconfig/conf.d/20-no-embedded.conf +cat <> ~/.config/fontconfig/conf.d/20-no-embedded.conf + + + + + + false + + + +EOF + +# Fixes. If you dont want em, remove em + +pacman -S \ + libappindicator-gtk3 `#Fixes blurry icons in Electron programs` \ + appmenu-gtk-module `#Fixes for GTK3 menus` \ + xdg-desktop-portal \ + xdg-desktop-portal `#These two instruct programs to show KDE's file picker whenever possible` \ + --noconfirm --needed + +PS3='Please enter your Drive type: ' +options=("SSD" "HDD" "NVME") +select opt in "${options[@]}" +do + case $opt in + "SSD") + echo "You chose SSD" + ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq" + ;; + "HDD") + echo "You chose HDD" + ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" + ;; + "NVME") + echo "You chose NVME" + ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/scheduler}="none" + ;; + *) echo "invalid option $REPLY";; + esac +done + +echo "Do you wish to install energy saving for Laptop" +select yn in "Yes" "No" +case $yn in + Yes ) sudo pacman -S tlp --noconfirm --needed + sudo systemctl enable tlp --now;; + No ) exit;; +esac + +echo "Do you wish to install RGB Software?" +select yn in "Yes" "No" +case $yn in + Yes ) sudo pacman -S openrgb solaar --noconfirm --needed;; + No ) exit;; +esac + +sudo journalctl --vacuum-size=100M +sudo journalctl --vacuum-time=2weeks +sudo systemctl enable --now systemd-journald.service + echo -e "\nDone!\n" -rm -rf /home/$(whoami)/Documents/temp +sudo grub-mkconfig -o /boot/grub/grub.cfg +sudo rm -rf /home/$(whoami)/Documents/temp ################################################################################ # # Chris, if you read this. Please look into here! -# https://gitlab.com/gabmus/bestArch#use-systemd-boot +# https://gitlab.com/gabmus/bestArch # This is a blessing from the gods. -# - Thanks, Chris -################################################################################ +# - Thanks, Lilly +################################################################################ \ No newline at end of file