Created
February 19, 2022 15:57
-
-
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 /
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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