dell-xps-9560-ubuntu-respin
dell-xps-9560-ubuntu-respin copied to clipboard
Touch screen power saving
Another power top tunable that could be set on boot:
echo 'auto' > '/sys/bus/usb/devices/1-9/power/control';
/lib/systemd/system/touchscren-powersave.service
[Unit]
Description=Enable touch screen powersave
[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 'auto' > '/sys/bus/usb/devices/1-9/power/control';"
[Install]
WantedBy=default.target
sudo systemctl enable touchscren-powersave
The reason I have these as services is because powertop autotune messes up with certain devices I have sometimes connected on boot. For instance my external keyboard or mouse become unresponsive on first interaction if they're idle for more than a few seconds, which is infuriating.
For some reason this script was working for me when invoking it manually, but not on boot. I think that there is some other process setting the autosuspend setting to "on" after the touchscreen-powersave service runs.
Regardless, I managed to make it work by changing the Type line to:
Type=idle
This delays the execution of the service to later in the boot to ensure that it won't be overridden by whatever was forcing autosuspend off.