
#!/bin/bash

#https://wiki.archlinux.org/title/Xorg/Keyboard_configuration
#https://www.reddit.com/r/linuxhardware/comments/vdc6tz/keyboard_in_multiple_ryzen_6000_laptops_not/

source common.sh

sudo pacman -S acpi iasl cpio
mkdir acpi_override
cd acpi_override
sudo acpidump > acpidump
acpixtract -a acpidump
iasl -d *.dat
cp $main_dir/systemConf/dsdt.dsl .
iasl -sa dsdt.dsl
mkdir -p kernel/firmware/acpi
cp dsdt.aml kernel/firmware/acpi
find kernel | cpio -H newc --create > acpi_override
sudo cp acpi_override /boot/
echo "GRUB_EARLY_INITRD_LINUX_CUSTOM=acpi_override" | sudo tee -a /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg
cd .. 
sudo rm -r acpi_override
