Instructions:
First go to Settings -> System -> Display -> Resolution, and note down your preferred GUI resolution. You will need it later.
On my Rpi (LE 11.0.1), the directory /storage/.config/sleep.conf.d was pre-installed. So I think that's the right one.
Please check whether you have it:
If you don't have it, create it:
Then delete /storage/.config/sleep.d:
Then go into the directory, and look what's inside:
I have a README and a sleep.conf.sample file inside. For your purpose, you have to add two more files:
- 99-toggle_rate.power
- 20-custom-sleep.sh
To create 99-toggle_rate.power, copy the following code into your SSH terminal, and hit Enter to execute it. Eventually edit the resolutions first, depending on your preferred GUI resolution (see above). To do so, copy the script into an editor of your local OS, and edit both lines. Then copy the result into your SSH terminal, and hit Enter. In case you're trapped in input mode after this (> sign before cursor), type EOF, and hit Enter.
cat >/storage/.config/sleep.conf.d/99-toggle_rate.power <<'EOF'
#!/bin/sh
case "$1" in
post)
xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 59.94
xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 60
;;
esac
EOF
After that you should see the new file:
Result:
Quote
99-toggle_rate.power README sleep.conf.sample
To create 20-custom-sleep.sh, copy the following code into your SSH terminal, and hit Enter to execute it:
cat >/storage/.config/sleep.conf.d/20-custom-sleep.sh <<'EOF'
#!/bin/sh
. /etc/profile
for script in $HOME/.config/sleep.conf.d/*.power; do
if [ -f $script ]; then
progress "running custom sleep script $script ($@)..."
sh $script $@
fi
done
exit 0
EOF
Display More
After that you should see the new file:
Result:
Quote
20-custom-sleep.sh README
99-toggle_rate.power sleep.conf.sample
Reboot, and hope that it works. 