sleepwalk: Inhibit suspend on hotspot or BT connected
This commit is contained in:
parent
f39e10ca57
commit
451b33d984
12
sleepwalk
12
sleepwalk
|
@ -58,8 +58,18 @@ network_activity() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bluetooth_connected() {
|
||||||
|
test "$(bluetoothctl devices Connected)" != ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
hotspot_active() {
|
||||||
|
nmcli c show --active | grep -e 'Hotspot'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
can_suspend() {
|
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
|
cpufreq-set -g powersave
|
||||||
|
|
Loading…
Reference in New Issue