feat: backups wake and sleep device

This commit is contained in:
strix 2026-08-28 02:20:28 +02:00
parent 83c51f89a9
commit a9f6470dc2
2 changed files with 13 additions and 1 deletions

View file

@ -43,7 +43,16 @@
timerConfig = {
OnCalendar = "daily";
Persistent = true;
WakeSystem = true;
RandomizedDelaySec = "5h";
};
backupCleanupCommand = ''
loginctl list-sessions --no-legend | awk '{print $1}' | while read -r s; do
class=$(loginctl show-session "$s" -p Class --value)
if [ "$class" = "user" ]; then
loginctl show-session "$s" -p LockedHint --value
fi
done | grep -qx no && echo "unlocked session found skip suspend" || systemctl suspend
'';
};
}