1
0
arch-installer/arch_install.sh

462 lines
16 KiB
Bash
Raw Normal View History

2022-10-13 13:37:50 +02:00
#!/bin/sh
## == My arch installer script == ##
#part1 installer iso
printf '\033c'
2022-11-04 15:04:47 +01:00
printf '%s\n' "Welcome, lets start this shi*t"
printf '%s\n' "Enabling parallel downloads and updating keyring"
2022-10-13 13:37:50 +02:00
sed -i "s/^#ParallelDownloads = 5/ParallelDownloads = 10/" /etc/pacman.conf
pacman --noconfirm -Sy archlinux-keyring
2022-11-04 15:04:47 +01:00
printf '%s\n' "Loading croatian keys"
2022-10-13 13:37:50 +02:00
loadkeys croat
2022-11-04 15:04:47 +01:00
printf '%s\n' "Connect to wifi if needed"
printf '%s\n' """Steps to connect
2022-10-13 13:37:50 +02:00
[iwd]# device list
[iwd]# station device scan
[iwd]# station device get-networks
[iwd]# station device connect SSID
"""
iwctl
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting ntp"
2022-10-13 13:37:50 +02:00
timedatectl set-ntp true
printf '\033c'
2022-11-04 15:04:47 +01:00
printf '%s\n' "Listing drives"
2022-10-13 13:37:50 +02:00
lsblk
2022-11-04 15:04:47 +01:00
printf '%s\n' "Enter the drive: "
2022-10-13 13:37:50 +02:00
read drive
cfdisk $drive
printf '\033c'
lsblk
2022-11-04 15:04:47 +01:00
printf '%s\n' "Enter the linux partition: "
2022-10-13 13:37:50 +02:00
read partition
mkfs.btrfs -f -L ARCH $partition
2022-10-13 13:37:50 +02:00
read -p "Did you also create swap partition? [y/n]: " answer
2022-10-13 13:37:50 +02:00
[[ $answer = "y" ]] && read -p "Enter swap partition: " swappartition
[[ ! -z ${swappartition+x} ]] && mkswap -L SWAP $swappartition
read -p "Did you also create efi partition? [y/n]: " answer
2022-10-13 13:37:50 +02:00
[[ $answer = y ]] && read -p "Enter EFI partition: " efipartition
2022-10-13 21:01:02 +02:00
[[ ! -z ${efipartition+x} ]] && mkfs.vfat -F 32 $efipartition
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up btrfs subvolumes"
2022-10-13 13:37:50 +02:00
mount $partition /mnt
cd /mnt
2022-11-04 15:04:47 +01:00
printf '%s\n' "Creating root subvolume"
2022-10-13 13:37:50 +02:00
btrfs subvolume create /mnt/@
2022-11-04 15:04:47 +01:00
printf '%s\n' "Creating home subvolume"
2022-10-13 13:37:50 +02:00
btrfs subvolume create /mnt/@home
2022-11-04 15:04:47 +01:00
printf '%s\n' "Creating cache subvolume"
2022-10-13 13:37:50 +02:00
btrfs subvolume create /mnt/@cache
2022-11-04 15:04:47 +01:00
printf '%s\n' "Creating log subvolume"
2022-10-13 13:37:50 +02:00
btrfs subvolume create /mnt/@log
2022-11-04 15:04:47 +01:00
printf '%s\n' "Unmounting root volume"
2022-10-13 13:37:50 +02:00
cd ~
umount -R /mnt
2022-11-04 15:04:47 +01:00
printf '%s\n' "Mounting the system"
printf '%s\n' "Mounting root btrs subvolume"
2022-10-13 18:33:16 +02:00
mount $partition -o subvol=/@ /mnt
2022-11-04 15:04:47 +01:00
printf '%s\n' "Mounting home btrs subvolume"
2022-10-13 13:37:50 +02:00
mkdir -p /mnt/home
2022-10-13 18:33:16 +02:00
mount $partition -o subvol=/@home /mnt/home
2022-11-04 15:04:47 +01:00
printf '%s\n' "Mounting cache btrs subvolume"
2022-10-13 13:37:50 +02:00
mkdir -p /mnt/var/cache
2022-10-13 18:33:16 +02:00
mount $partition -o subvol=/@cache /mnt/var/cache
2022-11-04 15:04:47 +01:00
printf '%s\n' "Mounting log btrs subvolume"
2022-10-13 13:37:50 +02:00
mkdir -p /mnt/var/log
2022-10-13 18:33:16 +02:00
mount $partition -o subvol=/@log /mnt/var/log
2022-10-13 13:37:50 +02:00
if [[ ! -z ${efipartition+x} ]]; then
2022-11-04 15:04:47 +01:00
printf '%s\n' "Mounting efi partition"
2022-10-13 13:37:50 +02:00
mkdir -p /mnt/boot
mount $efipartition /mnt/boot
fi
if [[ ! -z ${swappartition+x} ]]; then
2022-11-04 15:04:47 +01:00
printf '%s\n' "Mounting swap partition"
2022-10-13 13:37:50 +02:00
swapon $swappartition
fi
read -n 1 -s -p "To continue press any key"
2022-11-04 15:04:47 +01:00
printf '%s\n' "Installing basic system packages"
printf '%s\n' "Do you have an intel or amd cpu, or none? [intel/amd/none]: "
2022-10-16 22:27:13 +02:00
read intelamd
if [ $intelamd = "intel" ]; then
pacstrap /mnt base linux-firmware linux-lts btrfs-progs intel-ucode
2022-10-19 19:08:31 +02:00
elif [ $intelamd = "amd" ]; then
2022-10-16 22:27:13 +02:00
pacstrap /mnt base linux-firmware linux-lts btrfs-progs amd-ucode
2022-10-19 19:08:31 +02:00
elif [ $intelamd = "none" ]; then
2022-10-19 19:04:02 +02:00
pacstrap /mnt base linux-firmware linux-lts btrfs-progs
2022-10-16 22:27:13 +02:00
fi
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Generating fstab"
2022-10-13 13:37:50 +02:00
genfstab -U /mnt >> /mnt/etc/fstab
2022-11-04 15:04:47 +01:00
printf '%s\n' "Generating chroot part of the script"
2022-10-13 13:37:50 +02:00
sed '1,/^#part2$/d' `basename $0` > /mnt/arch_install2.sh
chmod +x /mnt/arch_install2.sh
arch-chroot /mnt ./arch_install2.sh
rm -rf /mnt/arch_install2.sh
2022-11-04 15:04:47 +01:00
printf '%s\n' "Unmounting everything"
umount -R /mnt
if [[ ! -z ${swappartition+x} ]]; then
2022-11-04 15:04:47 +01:00
printf '%s\n' "Unmouning swap partition"
swapoff $swappartition
fi
2022-10-13 13:37:50 +02:00
exit
#part2
printf '\033c'
pacman -Syu
pacman -S --noconfirm --needed sed
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up pacman settings."
2022-10-13 13:37:50 +02:00
sed -i "s/^#Color/Color/" /etc/pacman.conf
sed -i "s/^#CheckSpace/CheckSpace/" /etc/pacman.conf
sed -i "s/^#VerbosePkgLists/VerbosePkgLists/" /etc/pacman.conf
sed -i "s/^#ParallelDownloads = 5/ParallelDownloads = 10/" /etc/pacman.conf
sed -i "s/^ParallelDownloads = 10/&\nILoveCandy/" /etc/pacman.conf
2022-10-13 13:37:50 +02:00
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
pacman -Syu
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up time zone"
2022-10-13 13:37:50 +02:00
ln -sf /usr/share/zoneinfo/Europe/Zagreb /etc/localtime
hwclock --systohc
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up locale"
printf '%s\n' "en_US.UTF-8 UTF-8" >> /etc/locale.gen
2022-10-13 13:37:50 +02:00
locale-gen
2022-11-04 15:04:47 +01:00
printf '%s\n' "LANG=en_US.UTF-8" > /etc/locale.conf
printf '%s\n' "KEYMAP=croat" > /etc/vconsole.conf
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up hostname and networking"
printf '%s\n' "Enter hostname: "
2022-10-13 13:37:50 +02:00
read hostname
2022-11-04 15:04:47 +01:00
printf '%s\n' $hostname > /etc/hostname
printf '%s\n' "127.0.0.1 localhost" >> /etc/hosts
printf '%s\n' "::1 localhost" >> /etc/hosts
printf '%s\n' "127.0.1.1 $hostname.localdomain $hostname" >> /etc/hosts
2022-10-13 13:37:50 +02:00
mkinitcpio -P
read -n 1 -s -p "To continue press any key"
2022-11-04 15:04:47 +01:00
printf '%s\n' "Downloading and setting better mirrorlist"
2022-10-13 19:45:19 +02:00
pacman -S --noconfirm --needed reflector rsync
2022-10-13 13:37:50 +02:00
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
reflector --latest 200 --sort rate --save /etc/pacman.d/mirrorlist
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up network managment"
2022-10-13 17:53:07 +02:00
pacman -S --noconfirm networkmanager dhcpcd openresolv
2022-10-13 13:37:50 +02:00
systemctl enable NetworkManager
2022-10-13 17:53:07 +02:00
systemctl enable dhcpcd
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting better dns servers as defaults"
2022-10-13 17:53:07 +02:00
sed -i 's/#name_servers=127.0.0.1/name_servers="94.140.14.14 94.140.15.15 2a10:50c0::ad1:ff 2a10:50c0::ad2:ff"/' /etc/resolvconf.conf
2022-10-13 13:37:50 +02:00
read -n 1 -s -p "To continue press any key"
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up xorg, gpu drivers and my xorg configs"
2022-11-06 13:30:49 +01:00
pacman -S --needed --noconfirm xorg-server xorg-server-common xorg-xsetroot xorg-xinit xorg-xinput xwallpaper xdotool
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you have an amd gpu/igpu [y/n]: "
2022-10-13 13:37:50 +02:00
read amd
[[ $amd = "y" ]] && pacman -S --needed --noconfirm xf86-video-amdgpu
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you have an nvidia gpu/dgpu [y/n]: "
2022-10-13 13:37:50 +02:00
read nvidia
[[ $nvidia = "y" ]] && pacman -S --needed --noconfirm nvidia-dkms nvidia-settings
2022-11-04 15:04:47 +01:00
printf '%s\n' "Are you running this in virtualbox? install virtualbox-guest-utils [y/n]"
2022-10-13 13:37:50 +02:00
read virtualbox
[[ $virtualbox = "y" ]] && pacman -S --needed --noconfirm virtualbox-guest-utils
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you have nvidia optimus [y/n]: "
2022-10-13 13:37:50 +02:00
read optimus
[[ $optimus = "y" ]] && [[ $nvidia = "y" ]] && pacman -S --needed --noconfirm nvidia-prime
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting xorg configurations"
2022-10-13 19:45:19 +02:00
2022-10-13 13:37:50 +02:00
mkdir -p /etc/X11/xorg.conf.d
2022-11-04 15:04:47 +01:00
printf '%s\n' "Section "InputClass"
2022-10-13 13:37:50 +02:00
Identifier "My Mouse"
Driver "libinput"
MatchIsPointer "yes"
Option "AccelProfile" "flat"
Option "AccelSpeed" "0"
EndSection" > /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
2022-11-04 15:04:47 +01:00
printf '%s\n' "Section "ServerFlags"
2022-10-13 13:37:50 +02:00
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
Option "BlankTime" "0"
EndSection" > /etc/X11/xorg.conf.d/10-monitor.conf
2022-11-04 15:04:47 +01:00
printf '%s\n' "Section "InputClass"
2022-10-13 13:37:50 +02:00
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "hr"
Option "XkbOptions" "caps:escape"
EndSection" > /etc/X11/xorg.conf.d/00-keyboard.conf
2022-11-04 15:04:47 +01:00
printf '%s\n' "Section "InputClass"
2022-10-13 13:37:50 +02:00
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "on"
Option "ClickMethod" "clickfinger"
Option "NaturalScrolling" "true"
Option "ScrollMethod" "edge"
EndSection" > /etc/X11/xorg.conf.d/40-libinput.conf
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you wanna preload amdgpu with mkinitcpio.conf [y/n]: "
2022-10-13 13:37:50 +02:00
read preload_amdgpu
2022-10-13 21:44:20 +02:00
[[ $preload_amdgpu = "y" ]] && sed -i 's/MODULES=()/MODULES=(amdgpu)/' /etc/mkinitcpio.conf
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up grub"
2022-10-13 13:37:50 +02:00
pacman --noconfirm -S grub efibootmgr os-prober
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
2022-10-13 13:37:50 +02:00
read -n 1 -s -p "To continue press any key"
2022-10-13 13:37:50 +02:00
if [[ $nvidia = "y" ]]; then
2022-10-30 17:44:25 +01:00
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 systemd.show_status=auto rd.udev.log_level=3 vt.global_cursor_default=0 nmi_watchdog=0 zswap.enabled=0 nvidia-drm.modeset=1 rcutree.rcu_idle_gp_delay=1"/' /etc/default/grub
2022-10-13 13:37:50 +02:00
else
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 rd.systemd.show_status=auto rd.udev.log_level=3 vt.global_cursor_default=0 nmi_watchdog=0 zswap.enabled=0"/' /etc/default/grub
fi
grub-mkconfig -o /boot/grub/grub.cfg
read -n 1 -s -p "To continue press any key"
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you wanna disable sp5100_tco driver for amd to disable it's watchdog (Can help with shutdown errors) [y/n]: "
2022-10-13 13:37:50 +02:00
read sp5100_tco
if [[ $sp5100_tco = "y" ]]; then
mkdir -p /etc/modprobe.d
2022-11-04 15:04:47 +01:00
printf '%s\n' "blacklist sp5100_tco" > /etc/modprobe.d/sp5100_tco.conf
2022-10-13 13:37:50 +02:00
fi
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you wanna set up better swappiness settings [y/n]: "
2022-10-13 13:37:50 +02:00
read swap_settings
if [[ $swap_settings = "y" ]]; then
mkdir -p /etc/sysctl.d
2022-11-04 15:04:47 +01:00
printf '%s\n' "vm.swappiness = 10" > /etc/sysctl.d/99-swappiness.conf
printf '%s\n' "vm.vfs_cache_pressure=50" > /etc/sysctl.d/99-vfs_cache_pressure.conf
2022-10-13 13:37:50 +02:00
fi
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you wanna disable network manager powersave [y/n]: "
2022-10-13 13:37:50 +02:00
read networkmanager_powersave
if [[ $networkmanager_powersave = "y" ]]; then
mkdir -p /etc/NetworkManager/conf.d
2022-11-04 15:04:47 +01:00
printf '%s\n' "[connection]
2022-10-13 13:37:50 +02:00
wifi.powersave = 2" > /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
fi
2022-11-04 15:04:47 +01:00
printf '%s\n' "Have an ssd? Enable fstrim and make it run daily [y/n]: "
2022-10-13 13:37:50 +02:00
read ssd
if [[ $ssd = "y" ]]; then
mkdir -v /etc/systemd/system/fstrim.timer.d
touch /etc/systemd/system/fstrim.timer.d/override.conf
2022-11-04 15:04:47 +01:00
printf '%s\n' "[Timer]
2022-10-30 17:44:25 +01:00
OnCalendar=
OnCalendar=daily" > /etc/systemd/system/fstrim.timer.d/override.conf
2022-10-13 13:37:50 +02:00
systemctl enable fstrim.timer
fi
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you wanna enable zram (uses half the ram) [y/n]: "
2022-10-13 13:37:50 +02:00
read zram
if [[ $zram = "y" ]]; then
2022-10-13 19:51:15 +02:00
pacman -S --noconfirm --needed zram-generator
2022-11-04 15:04:47 +01:00
printf '%s\n' '[zram0]
2022-10-30 17:44:25 +01:00
zram-size = ram / 2' > /etc/systemd/zram-generator.conf
2022-10-13 13:37:50 +02:00
fi
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you wan't to disable hibernation [y/n]: "
2022-10-16 22:27:13 +02:00
read hibernation
[[ $hibernation = "y" ]] && systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
[[ $nvidia = "y" ]] && read -p "Do you wanna enable a fix for /oldroot/ during shutdown with nvidia? [y/n]: " oldroot_fix
2022-10-13 13:37:50 +02:00
if [[ $oldroot_fix = "y" ]]; then
mkdir -p /usr/lib/systemd/system-shutdown
2022-11-04 15:04:47 +01:00
printf '%s\n' "#!/bin/sh
2022-10-30 17:44:25 +01:00
# remove nvidia modules
/usr/bin/modprobe -r nvidia_drm nvidia_modeset nvidia_uvm && /usr/bin/modprobe -r nvidia" > /usr/lib/systemd/system-shutdown/nvidia.shutdown
chmod +x /usr/lib/systemd/system-shutdown/nvidia.shutdown
2022-10-13 13:37:50 +02:00
fi
2022-11-05 10:54:42 +01:00
printf '%s\n' "Setting better journald sizes"
2022-11-06 14:25:55 +01:00
mkdir -p /etc/systemd/journald.conf.d/
2022-11-05 10:54:42 +01:00
printf '%s\n' "[Journal]
SystemMaxUse=250M
SystemMaxFileSize=50M" > /etc/systemd/journald.conf.d/size.conf
2022-11-04 15:04:47 +01:00
printf '%s\n' "Installing basic packages and enabling basic services"
pacman -S --noconfirm zsh p7zip unzip xclip base-devel \
2022-10-25 22:07:56 +02:00
pacman-contrib wireless_tools man pcmanfm fzf git android-file-transfer \
2022-10-30 19:09:54 +01:00
pipewire pipewire-pulse pipewire-alsa rtkit openssh android-udev \
alsa-plugins alsa-tools alsa-utils pulsemixer pamixer \
2022-10-13 13:37:50 +02:00
firefox playerctl lxsession bluez bluez-utils syncthing \
2022-10-25 22:07:56 +02:00
keepassxc thunderbird shotgun xdotool bat acpid imagemagick\
ufw hugo python-pygments python-gitpython udisks2 hacksaw \
2022-10-22 18:14:31 +02:00
ccache smartmontools libreoffice-still aria2 ghostscript
2022-10-13 13:37:50 +02:00
systemctl enable rtkit-daemon.service
systemctl enable bluetooth.service
systemctl enable acpid.service
read -n 1 -s -p "To continue press any key"
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up makepkg.conf"
2022-10-19 21:07:47 +02:00
sed -i 's/-march=native/-march=x86-64 -mtune=generic/' /etc/makepkg.conf
sed -i 's/!ccache/ccache/g' /etc/makepkg.conf
2022-11-04 15:04:47 +01:00
printf '%s\n' "Set root password"
2022-10-13 13:37:50 +02:00
passwd
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up user"
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
printf '%s\n' "Enter Username: "
2022-10-13 13:37:50 +02:00
read username
2022-10-19 21:07:47 +02:00
useradd -m $username
passwd $username
usermod -a $username -G wheel
2022-10-13 13:37:50 +02:00
usermod -a $username -G network
usermod -a $username -G video
usermod -a $username -G input
usermod -a $username -G audio
read -n 1 -s -p "To continue press any key"
printf '%s\n' "Setting up silent boot and autologin"
mkdir -p /etc/sysctl.d
printf '%s\n' "kernel.printk = 3 3 3 3" > /etc/sysctl.d/20-quiet-printk.conf
mkdir -p /etc/systemd/system/getty@tty1.service.d
printf '%s\n' "[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --skip-login --nonewline --noissue --autologin $username --noclear %I \$TERM" > /etc/systemd/system/getty@tty1.service.d/skip-prompt.conf
2022-10-13 13:37:50 +02:00
ai3_path=/home/$username/arch_install3.sh
sed '1,/^#part3$/d' arch_install2.sh > $ai3_path
chown $username:$username $ai3_path
chmod +x $ai3_path
su -c $ai3_path -s /bin/sh $username
rm -rf $ai3_path
2022-11-04 15:04:47 +01:00
printf '%s\n' "Pre-Installation Finish Reboot now"
2022-10-13 13:37:50 +02:00
exit
#part3
2022-11-02 21:29:30 +01:00
cd ~
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up paru"
2022-10-25 22:07:56 +02:00
sudo pacman -S --noconfirm --needed go rust nodejs npm cmake git zig
git clone https://aur.archlinux.org/paru.git ~/paru
cd ~/paru
2022-11-03 17:26:22 +01:00
makepkg -si
read -n 1 -s -p "To continue press any key"
cd ~
rm -rf ~/paru
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up additional must have aur packages"
paru -S --needed --noconfirm brillo dmenu-bluetooth clipmenu-git xdg-ninja-git tutanota-desktop-bin ferdium-bin colorpicker yt-dlp downgrade dashbinsh
2022-10-13 13:37:50 +02:00
read -n 1 -s -p "To continue press any key"
2022-11-04 15:04:47 +01:00
printf '%s\n' "Getting my arch dotfiles"
2022-10-30 17:44:25 +01:00
mkdir -p ~/repos/dots
cd ~/repos/dots
git clone https://github.com/cronyakatsuki/arch-dots.git arch
read -n 1 -s -p "To continue press any key"
2022-10-13 13:37:50 +02:00
mkdir ~/.config
cd ~/repos/dots/arch
2022-11-04 11:44:53 +01:00
make
2022-11-04 15:04:47 +01:00
printf '%s\n' "Getting my general dotfiles"
mkdir -p ~/repos/dots
cd ~/repos/dots
git clone https://github.com/cronyakatsuki/general-dots.git general
read -n 1 -s -p "To continue press any key"
cd ~/repos/dots/general
2022-11-04 11:44:53 +01:00
make
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Getting my scripts"
mkdir -p ~/bin
cd ~/repos/dots
git clone https://github.com/cronyakatsuki/scripts.git ~/repos/dots/scripts
read -n 1 -s -p "To continue press any key"
ln -s $HOME/repos/dots/scripts $HOME/bin/misc
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up neovim"
2022-10-13 13:37:50 +02:00
sudo pacman -S --noconfirm --needed neovim ripgrep
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim
git clone https://github.com/cronyakatsuki/nvim-conf ~/.config/nvim
read -n 1 -s -p "To continue press any key"
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up slock"
2022-10-13 13:37:50 +02:00
git clone https://github.com/cronyakatsuki/slock.git ~/repos/slock
cd ~/repos/slock
sudo make install clean
read -n 1 -s -p "To continue press any key"
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up dmenu and dmenu scripts"
2022-10-13 13:37:50 +02:00
git clone https://github.com/cronyakatsuki/dmenu.git ~/repos/dmenu
cd ~/repos/dmenu
sudo make install clean
git clone https://github.com/cronyakatsuki/dmenu-scripts.git ~/repos/dmenu-scripts
ln -s $HOME/repos/dmenu-scripts $HOME/bin/dmenu
read -n 1 -s -p "To continue press any key"
2022-10-13 13:37:50 +02:00
2022-11-05 10:59:46 +01:00
touch ~/.hushlogin
2022-10-13 13:37:50 +02:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Do you wan't to setup gaming related packages, settings and optimizations? [y/n]"
2022-10-13 13:37:50 +02:00
read gaming
if [[ $gaming = "y" ]]; then
if pacman -Qi nvidia-dkms > /dev/null; then
2022-11-04 15:04:47 +01:00
printf '%s\n' "Installing nvidia drivers"
2022-10-13 13:37:50 +02:00
sudo pacman -S --noconfirm --needed nvidia-dkms nvidia-utils lib32-nvidia-utils nvidia-settings vulkan-icd-loader lib32-vulkan-icd-loader
fi
if pacman -Qi xf86-video-amdgpu > /dev/null; then
2022-11-04 15:04:47 +01:00
printf '%s\n' "Installing amdgpu drivers"
2022-10-13 13:37:50 +02:00
sudo pacman -S --noconfirm --needed lib32-mesa vulkan-radeon lib32-vulkan-radeon vulkan-icd-loader lib32-vulkan-icd-loader
fi
2022-11-05 18:05:33 +01:00
2022-11-04 15:04:47 +01:00
printf '%s\n' "Installing wine dependencies"
2022-10-13 13:37:50 +02:00
sudo pacman -S --needed --noconfirm wine-staging giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls \
mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error \
lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo \
sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama \
2022-11-02 21:29:30 +01:00
ncurses lib32-ncurses ocl-icd lib32-ocl-icd libxslt lib32-libxslt libva lib32-libva gtk3 vkd3d lib32-vkd3d \
2022-10-13 13:37:50 +02:00
lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-icd-loader lib32-vulkan-icd-loader
2022-11-04 15:04:47 +01:00
printf '%s\n' "Installing gaming related software"
2022-10-13 19:58:32 +02:00
paru -S --needed --noconfirm lib32-gamemode-git gamemode-git lib32-mangohud-git mangohud-common-git mangohud-git steam \
2022-10-13 13:37:50 +02:00
lutris python-magic winetricks protontricks proton-ge-custom-bin \
heroic-games-launcher-bin libstrangle-git --needed --noconfirm
2022-11-04 15:04:47 +01:00
printf '%s\n' "Setting up gamemode"
2022-10-13 13:37:50 +02:00
sudo usermod -a `whoami` -G gamemode
2022-11-04 15:04:47 +01:00
printf '%s\n' "@gamemode - nice 10" | sudo tee -a /etc/security/limits.conf
printf '%s\n' '<driconf>
2022-10-13 13:37:50 +02:00
<device>
<application name="Default">
<option name="vblank_mode" value="0" />
</application>
</device>
</driconf>' > /etc/drirc
2022-11-04 15:04:47 +01:00
printf '%s\n' "Creating the default wine prefix folder"
2022-10-13 13:37:50 +02:00
mkdir -p $HOME/.local/share/wineprefixes/default
fi
2022-11-02 21:29:30 +01:00
exit