Synaptics touchpad loses config after modprobing driver

Well, I was having trouble with the touchpad in my Acer E5-571, using openSUSE 13.2 … What happened was, after waking up from suspended or hibernation, the touchpad would not work anymore. Turns out that by removing and enabling the i2c_hid module at the pre- and post- sleep events in systemd seemed to fix it for me but at a cost: it loses all the settings I put in /etc/X11/xorg.conf.d/50.synaptics.conf when it wakes up! I know this is an expected behavior, but keep on reading.

(I got the solution above here: https://forums.opensuse.org/showthread.php/504589-Dell-touchpad-disabled-after-suspend?p=2691324#post2691324)

Then I thought “I got this, hold my beer” then promptly went on to make a shell script to set the missing touchpad settings using synclient after it had already modprobed i2c_hid. Sigh, well, it didn’t work! Then I used systemctl status to see what was happening and the log said:

fix_touchpad[17455]: Failed to connect to X Server.

After some research I found out that synclient can’t connect to the X Server because it doesn’t know the X display to use or something like that. I put DISPLAY=:0; export DISPLAY before the synclient’s and still doesn’t work.

The questions are:

  1. How do I get synclient to work in that script?
  2. Or maybe make it “reload” the settings I put in xorg.conf.d?
  3. Or even so present me to a better fix for the touchpad problem so I don’t have to modprobe that sheet.

Here is a xinput output in advance:

maran@linux:~> xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SYN1B7E:01 06CB:2970 UNKNOWN              id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ HD WebCam                                 id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=11   [slave  keyboard (3)]
    ↳ Acer WMI hotkeys                          id=12   [slave  keyboard (3)]

I appreciate any kindness, since I’m a Linux beginner. :slight_smile:

I haven’t looked into this deeply, but I think you’ll need to create a resume@user service to run the required commands as described here

https://wiki.archlinux.org/index.php/Power_management#Suspend.2Fresume_service_files

Yerp, got it to work. Thank you!
It’s a workaround but I hope all these inconsistencies with touchpads get solved in the next release.

Anyway…

I’ve created resume@.service at /etc/systemd/system with the contents

[Unit]
Description=User resume actions
After=root-suspend.target

[Service]
User=%I
Environment=DISPLAY=:0
Type=simple
ExecStartPre=/usr/bin/sleep 5
ExecStart=/usr/local/bin/touchpad_settings

[Install]
WantedBy=suspend.target

then

$ systemctl enable resume@username-here.service

It’s not really perfect but worked for me.

Thanks for reporting back. Good to know, and likely to be of help to others who come searching. :slight_smile: