Compare commits
2 Commits
f39e10ca57
...
bf00cb71c8
Author | SHA1 | Date |
---|---|---|
Xavier Del Campo Romero | bf00cb71c8 | |
Xavier Del Campo Romero | 451b33d984 |
15
sleepwalk
15
sleepwalk
|
@ -58,8 +58,18 @@ network_activity() {
|
|||
return 1
|
||||
}
|
||||
|
||||
bluetooth_connected() {
|
||||
test "$(bluetoothctl devices Connected)" != ""
|
||||
return
|
||||
}
|
||||
|
||||
hotspot_active() {
|
||||
nmcli c show --active | grep -e 'Hotspot'
|
||||
return
|
||||
}
|
||||
|
||||
can_suspend() {
|
||||
! ( is_inhibitor_active || is_screen_on || is_charging || network_activity )
|
||||
! ( is_inhibitor_active || is_screen_on || is_charging || bluetooth_connected|| hotspot_active || network_activity )
|
||||
}
|
||||
|
||||
cpufreq-set -g powersave
|
||||
|
@ -68,8 +78,7 @@ while :
|
|||
do
|
||||
if can_suspend
|
||||
then
|
||||
rtcwake -m no -s 600 || :
|
||||
systemctl suspend
|
||||
(rtcwake -m no -s 600 && systemctl suspend) || :
|
||||
|
||||
if can_suspend
|
||||
then
|
||||
|
|
Loading…
Reference in New Issue