A hint to help with suspend-related issues - Printable Version

+- PINE64 (
+-- Forum: Pinebook Pro (
+--- Forum: General Discussion on Pinebook Pro (
+--- Thread: A hint to help with suspend-related issues (/showthread.php?tid=8241)

A hint to help with suspend-related issues - diodelass - 11-07-2019

I'm posting this here because I just fixed an irritating issue on my Pinebook Pro and want others to be able to do the same if/when it affects them.

If you've put your Pinebook Pro to sleep and returned to it later, you may have noticed that there are sometimes things broken when it wakes back up. On mine, the keyboard layout modifications I've set using xmodmap (converting caps lock to a second escape, and the |\ key right beside left shift to be an additional left shift, since I'm used to the wider key provided on ANSI keyboards) all get reset back to defaults, and my trackpad stops responding to taps. Both of these were cramping my style enough that was just electing not to use suspend at all.

The solution to these problems is just to run two commands:
xinput set-prop "HAILUCK CO.,LTD USB KEYBOARD Touchpad" "libinput Tapping Enabled" 1
to enable touchpad taps, and
xmodmap ~/.Xmodmap
to set my keymap modifications in X.

However, in order to make these happen automatically, we need a way to run commands - which, unfortunately, have to happen within the domain of X - right after the computer resumes from sleep mode. This is a bit more complicated than it should be, but don't worry, I figured that out too.

Step 1: as root, open a new text file in your favorite editor at /etc/systemd/system/resume@.service, and put in these lines:
Description=User suspend actions



Next, run these commands, also as root:
systemctl daemon-reload
systemctl enable resume@diodelass
(with your name instead of mine after the @, of course!)

Step 2: create the file in your home directory, and mark it executable (chmod +x
My looks like this now:

# hold for five seconds to allow the keyboard and touchpad to renumerate
sleep 5

xinput set-prop "HAILUCK CO.,LTD USB KEYBOARD Touchpad" "libinput Tapping Enabled" 1
xmodmap ~/.Xmodmap

Your commands can, of course, be whatever you need. I don't know what other problems with suspending there are on the Pinebook Pro yet, but this little bit of plumbing gives you what you need to put your fixes into action as soon as you know what they are; once you've found a command to fix the resume-related problem, you can simply drop it into and it will be run every time your machine wakes up.

Best of luck to everyone in getting your new system tweaked to perfection!