Skip to content

Instantly share code, notes, and snippets.

@twisted-nematic57
Created September 4, 2026 02:39
Show Gist options
  • Select an option

  • Save twisted-nematic57/fc46b2b2f4942b64c6515cfb39b1ea47 to your computer and use it in GitHub Desktop.

Select an option

Save twisted-nematic57/fc46b2b2f4942b64c6515cfb39b1ea47 to your computer and use it in GitHub Desktop.
Software duct tape over my Framework Laptop 12's hardware issues
#!/bin/bash
# FW12 KDE on-the-fly touchpad & display fixer script by Akshaya Singh (twisted_nematic57)
# Effects:
# 1. Gently turns on and off all connected displays. (Can temporarily fix eDP loose connection issues)
# 2. Effectively "reboots" the trackpad firmware by removing it from the PCI bus and then re-adding it. (Can temporarily fix severe discalibration issues caused by sweaty hands)
# [Note on "temporary": just run the script again if these problems begin again.]
# To use:
# 0. Run `cat /proc/bus/input/devices` and look for "PIXA3854:00 093A:0239 Touchpad". Note down the start of its Sysfs address, e.g. mine is `/devices/pci0000:00/0000:00:19.0`
# 1. Place this script in ~/.local/bin/reset-hardware.sh
# 2. Add `{yourusername} ALL=(ALL) NOPASSWD: /usr/bin/tee /sys/bus/pci/devices/0000\:00\:19.0/remove, /usr/bin/tee /sys/bus/pci/rescan`; change the 19 to whatever you got in step 0
# 3. (Optional) Bind it to a keyboard shorcut using KDE System Settings app.
# 1. Force the touchpad to reboot, to remove 'disorientation'
echo 1 | sudo tee /sys/bus/pci/devices/0000:00:19.0/remove > /dev/null
sleep 0.5
echo 1 | sudo tee /sys/bus/pci/rescan > /dev/null
# 2. Toggle global DPMS to power cycle ALL connected screens - this does NOT affect the desktop window layout at all
kscreen-doctor --dpms off
sleep 1.5
kscreen-doctor --dpms on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment