Created
January 12, 2020 22:15
-
-
Save shinyquagsire23/2a5b472abe3221c52b8be817d4145260 to your computer and use it in GitHub Desktop.
Surface Go ChromeOS touchscreen fix - on-wake script and upstart daemon config
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/bash | |
# copy to /usr/sbin | |
interface=org.chromium.PowerManager | |
member=SetPolicy | |
# Run once just to be sure | |
echo "Surface Go fix daemon start..." > /dev/kmsg | |
echo "on" > /sys/devices/pci0000:00/0000:00:15.1/i2c_designware.1/power/control | |
# And run every time the system enters and returns from suspend | |
dbus-monitor --system "interface='$interface', member='$member'" | | |
while read update; do | |
if [[ "$update" =~ "$member" ]]; then | |
echo "Power policy updated... Fixing touchscreen." > /dev/kmsg | |
echo "on" > /sys/devices/pci0000:00/0000:00:15.1/i2c_designware.1/power/control | |
fi | |
done |
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
# copy to /etc/init/ | |
description "Surface Go touchscreen daemon" | |
author "Max Thomas [email protected]" | |
start on started powerd | |
stop on stopping powerd | |
expect fork | |
respawn | |
respawn limit 3 10 # if the job respawns 3 times in 10 seconds, stop trying. | |
env VMODULE_ARG= | |
env UPSTART_RUN=1 | |
exec /usr/sbin/surfacego-touchscreen & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment