On Ubuntu 13.04 I have to manually configure the touchpad since a bug prevents me using the standard configuration tool (changes don't save). However I created a script that sets up velocity, acceleration and scrolling, configured it to run at sartup and it works. The problem rises when I resume after suspension: especially the scrolling settings (the easiest to check) disappear.
Following other questions and answers I wrote this script (which contains the same commands I used in the over-mentioned one) located in /etc/pm/sleep.d/ZZtouchpad
:
#!/bin/sh
case "$1" in
resume|thaw)
xinput --set-prop "CyPS/2 Cypress Trackpad" "Device Accel Constant Deceleration" 2
xinput --set-prop "CyPS/2 Cypress Trackpad" "Device Accel Velocity Scaling" 35
xinput --set-prop "CyPS/2 Cypress Trackpad" "Synaptics Scrolling Distance" -20, -20
esac
But it doesn't work at all.
Thnks for help!
EDIT
I found out that the script works when suspending with pm-suspend
or pm-suspend-hybrid
, but when suspending from the system menu or closing the laptop lid it doesn't. It seems the error is 'unable to connect to X server'.
So, the question better be rephrased: where should I put those commands for them to be executed when the X session is resumed? I tried ~/.xinitrc
, a file under ~/.xinitrc.d
and ~/.xsessionrc
. Any suggestions?