Skip to content

Instantly share code, notes, and snippets.

@torgeir
Created February 19, 2022 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torgeir/5c911ebcdc38b44005a7d951cc0c952d to your computer and use it in GitHub Desktop.
Save torgeir/5c911ebcdc38b44005a7d951cc0c952d to your computer and use it in GitHub Desktop.
Bring back display after sleep. Keywords: manjaro nvidia lightdm blurlock i3exit xrandr. Double -- in filename means /
[Unit]
Description=Make the screen come back after waking from suspend
After=suspend.target
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 5s
ExecStart=/home/torgeir/bin/after-sleep.sh
[Install]
WantedBy=suspend.target
#!/bin/bash
# say it like you really mean it
while true; do
# https://unix.stackexchange.com/questions/584901/lightdm-sometimes-resumes-with-a-blank-display-after-suspend
sudo -u torgeir env DISPLAY=:0 /bin/xrandr --auto && break;
sleep 1;
done
# run on boot:
# systemctl enable after-sleep.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment