diff options
| author | Robert Günzler <r@gnzler.io> | 2022-11-24 21:04:18 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-11-24 21:11:03 +0100 |
| commit | 01ae2efe1192caf4b129ddddc9696ab2872a2271 (patch) | |
| tree | d532191e391edfe8638fb6ae580b33eea6c743d9 /bin/r2mem | |
| parent | e574d523fb612f5a3e4c5fed7cd59a201cf4752b (diff) | |
add r2mem script and run when lid closes
Diffstat (limited to '')
| -rwxr-xr-x | bin/r2mem | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/r2mem b/bin/r2mem new file mode 100755 index 0000000..0120dbb --- /dev/null +++ b/bin/r2mem @@ -0,0 +1,10 @@ +#!/bin/sh +# setup trap to reset backlight +# shellcheck disable=SC2064 +trap "light -S $(light -G)" EXIT +# dim backlight before locking to avoid lockscreen flash +light -S "$(light -P)" +# setup lockscreen +lock >/dev/null 2>&1 +# go to sleep +echo mem | doas tee /sys/power/state >/dev/null |