A hint to help with suspend-related issues
#1
Information 
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:
Code:
xinput set-prop "HAILUCK CO.,LTD USB KEYBOARD Touchpad" "libinput Tapping Enabled" 1
to enable touchpad taps, and
Code:
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:
Code:
[Unit]
Description=User suspend actions
After=suspend.target

[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
ExecStart=/home/%I/.resume.sh

[Install]
WantedBy=suspend.target

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

Step 2: create the file .resume.sh in your home directory, and mark it executable (chmod +x .resume.sh).
My .resume.sh looks like this now:
Code:
#!/bin/bash

# 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 .resume.sh and it will be run every time your machine wakes up.

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issues with T-Mobile Home Internet? skinnyonthebebop 3 1,058 10-17-2023, 07:42 AM
Last Post: skinnyonthebebop
  Got a PBP - batch(August/September) and the audio is not good(2 big issues) crazyquark 2 1,475 10-01-2022, 10:16 AM
Last Post: crazyquark
  MiniConda Install Issues nixyhustle 0 775 09-16-2022, 10:06 PM
Last Post: nixyhustle
  new PBP issues jpjnh 9 3,852 08-22-2022, 07:26 AM
Last Post: wdt
  high battery drain on suspend/poweroff wiz 5 5,033 02-10-2022, 11:52 AM
Last Post: wdt
  Issues with External Display After Recent Update reundo 0 1,362 11-18-2021, 06:37 PM
Last Post: reundo
  HArdware issues while charging user18130814200115 2 2,805 05-01-2021, 04:13 AM
Last Post: gabeeg
  Issues with chromium-docker PVD 4 6,377 12-17-2020, 10:11 PM
Last Post: warehouses
  Power consumption and suspend to ram robt 33 42,758 11-30-2020, 04:32 PM
Last Post: wdt
  App installation issues on PBP pineitup 0 1,672 10-21-2020, 06:23 PM
Last Post: pineitup

Forum Jump:


Users browsing this thread: 1 Guest(s)