2023-10-08 01:57:01 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2023-10-08 04:20:52 +00:00
|
|
|
#!nix-shell -i bash -p coreutils -p util-linux
|
2023-10-08 01:57:01 +00:00
|
|
|
|
|
|
|
# yeah, this isn't technically a hook, but the hook infrastructure isn't actually
|
|
|
|
# restricted to stuff that starts with sxmo_hook_ ...
|
|
|
|
#
|
|
|
|
# this script is only called by sxmo_autosuspend, which is small, so if i wanted to
|
|
|
|
# be more proper i could instead re-implement autosuspend + integrations.
|
|
|
|
|
|
|
|
. sxmo_common.sh
|
|
|
|
|
2023-10-08 04:16:37 +00:00
|
|
|
suspend_time=300
|
2023-10-08 01:57:01 +00:00
|
|
|
|
2023-10-08 17:12:53 +00:00
|
|
|
sxmo_log "calling suspend for duration: $suspend_time"
|
2023-10-08 01:57:01 +00:00
|
|
|
|
|
|
|
rtcwake -m mem -s "$suspend_time" || exit 1
|
|
|
|
|
2023-10-08 17:12:53 +00:00
|
|
|
sxmo_log "exited suspend: $(cat /proc/net/rtl8723cs/wlan0/wowlan_last_wake_reason)"
|
2023-10-08 04:20:52 +00:00
|
|
|
|
2023-10-08 01:57:01 +00:00
|
|
|
sxmo_hook_postwake.sh
|
|
|
|
|