Ubuntu – Power management hook for running *X11* scripts on wake

d-buslinuxpower-managementUbuntux11

Earlier I asked a similar question, but that one was about running system-level scripts.

I have a script that runs a series of xinput commands in order to enable two-finger scrolling on my touchpad. It has to be re-run every time the computer sleeps and wakes up again, and it has to be run from within the X11 session. How do I trigger a script to be run on my X11 desktop when the computer wakes up?

P.S. I suspect there's a way to do this with DBUS, but I' m fuzzy on the specifics. Maybe someone with stronger DBUS-fu could point me in the right direction.

Best Answer

If you have gnome-control-center installed, run gnome-mouse-properties and visit Touchpad tab and click on Two-finger scrolling:

enter image description here

It works very well, and across wake-ups too. So, unless you are using your scripts for something else too, throw them away :)

Related Question