Last active
June 5, 2022 22:23
-
-
Save Placidina/6d079ee11d4fd8a3627a5424eda0380a to your computer and use it in GitHub Desktop.
Script hotfix Lenovo S145 touchpad and bluetooth headset on Fedora 34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| KERNEL_TOUCHPAD="i8042.nopnp=1 pci=nocrs" | |
| BROADCOM_BT_FIRMWARE_RPM_URL="https://github.com/winterheart/broadcom-bt-firmware/releases/download/v12.0.1.1105_p3/broadcom-bt-firmware-10.1.0.1115.rpm" | |
| _touchpad() { | |
| if ! grep "${KERNEL_TOUCHPAD}" /etc/default/grub > /dev/null 2>&1; then | |
| sudo sed -i -E "s/(GRUB_CMDLINE_LINUX=)\"(.*)\"/\1\"${KERNEL_TOUCHPAD} \2\"/g" /etc/default/grub | |
| sudo grub2-mkconfig -o /boot/grub2/grub.cfg | |
| fi | |
| } | |
| _headset() { | |
| sudo dnf install -y ${BROADCOM_BT_FIRMWARE_RPM_URL} | |
| } | |
| OPTIONS=( | |
| "Touchpad" | |
| "Bluetooth Headset" | |
| "Reboot" | |
| "Exit" | |
| ) | |
| PS3='Option: ' | |
| while true; do | |
| select opt in "${OPTIONS[@]}"; do | |
| case $REPLY in | |
| 1) _touchpad; break ;; | |
| 2) _headset; break ;; | |
| 3) sudo shutdown -r now ;; | |
| 4) break 2 ;; | |
| *) echo >&2 "Invalid option" ;; | |
| esac | |
| done | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run:
sh -c "$(curl -sSL https://gist.githubusercontent.com/Placidina/6d079ee11d4fd8a3627a5424eda0380a/raw/50212bb2c10cbbe6d4bb090076cd464b2f16e08b/lenovo-s145-fedora34-hotfix.sh)"