|
@@ -146,6 +146,20 @@ TimeoutStopSec=5"; then
|
|
|
reload_needed=1
|
|
reload_needed=1
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
|
|
+# ---------------------------------------------------------------------------
|
|
|
|
|
+# sleep: suspend-then-hibernate hibernates after 2h asleep (jellyfish only).
|
|
|
|
|
+#
|
|
|
|
|
+# sway's swayidle and lid switch call suspend-then-hibernate. This laptop only
|
|
|
|
|
+# supports s2idle, which drains the battery noticeably, so a forgotten suspend
|
|
|
|
|
+# would otherwise run it flat. Unset, systemd guesses from the discharge rate;
|
|
|
|
|
+# a fixed delay is predictable. Read at sleep time -- no reload needed.
|
|
|
|
|
+# ---------------------------------------------------------------------------
|
|
|
|
|
+if [[ $hostname_id == jellyfish ]]; then
|
|
|
|
|
+ install_file /etc/systemd/sleep.conf.d/10-hibernate-delay.conf \
|
|
|
|
|
+"[Sleep]
|
|
|
|
|
+HibernateDelaySec=2h" || true
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
if [[ $reload_needed -eq 1 ]]; then
|
|
if [[ $reload_needed -eq 1 ]]; then
|
|
|
log_info "Reloading systemd"
|
|
log_info "Reloading systemd"
|
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl daemon-reload
|