6

in Ubuntu 10.10 I really don't want any password on resume on my EeePC, so I have to run

gconftool-2 --set --type=bool /apps/gnome-power-manager/lock/suspend false

and I want two finger middle click, so I have to run

xinput set-prop "ETPS/2 Elantech Touchpad" "Synaptics Tap Action" 8, 9, 0, 0, 1, 2, 3 (that gpointingdevice package can't do anything for me)

Those work, but only until the next resume. For some strange reason Ubuntu always overrides these changes.

I put both commands into a script in /etc/pm/sleep.d/ , but even then after resumes the changes are gone.

Where is this strange behavior coming from? And how do I make those changes permanent?

  • I'm not even able to comment anymore because I spent all my reputation on this bounty, but the answer that was auto-selected does not help at all. This is an unsolved and very annoying problem. – slikts May 24 '11 at 8:23
2

You could add those commands in sh file

#!/bin/sh
gconftool-2 --set --type=bool /apps/gnome-power-manager/lock/suspend false
xinput set-prop "ETPS/2 Elantech Touchpad" "Synaptics Tap Action" 8, 9, 0, 0, 1, 2, 3

save it as startup.sh(for example) and put it in System->Preferences->Startup Applications. Oh and add permission executing this file as program in file context menu->Permissions

  • 1
    This answer is off the mark. He's asking about running a script on resume, because the touchpad settings get reset after resuming from sleep. /etc/pm/sleep.d/ doesn't work, because it probably runs too early. – slikts May 8 '11 at 10:00
2
+50

You should be aware that all sleep.d script run as root and could easily be the problem here.

  • You can add debugging information to your script such as echo "Touchpad command" which will then appear in the logs. More info

  • Open the logs by using Log File Viewer and find pm-suspend.log then search for the echo comments you added to your script and look for any errors.

  • If you need help deciphering the logs copy and paste them to dpaste and paste that link here.

  • You may be able to run these commands as another user with su username -c command

2

For Ubuntu Oneiric, you should use the new hotplug-command hook. Basically, you create a script using this template that calls xinput with your desired settings somewhere in your path, make it executable, and then:

gsettings set org.gnome.settings-daemon.peripherals.input-devices hotplug-command <script>

The script will be called on startup, resume, and whenever the device is plugged/unplugged.

1

I just added this as /etc/pm/sleep.d/99_touchpad (don't forget to chmod +x.) Works fine in Debian Wheezy so it should work the same in recent Ubuntu versions:

#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
case "${1}" in
        hibernate)
                ;;
        resume|thaw)
        DISPLAY=:0.0 su <username> -c /home/<username>/touchpad.sh
                ;;
esac

Substitute your own user name of course. My touchpad.sh (which is also called via "Startup Applications") is

#!/bin/bash
dev="ETPS/2 Elantech Touchpad"
# Use xinput --list-props "ETPS/2 Elantech Touchpad" to list data
xinput set-prop "$dev" "Synaptics Tap Action" 8, 9, 0, 0, 1, 2, 3
xinput set-prop "$dev" "Synaptics Locked Drags" 1
xinput set-prop "$dev" "Synaptics Locked Drags Timeout" 500

to set locked dragging and two-finger middle click.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.