diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-03 20:07:40 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-03 20:07:40 +0200 |
| commit | 451b33d98477ea48be795e50951c21ff4fc188c2 (patch) | |
| tree | c21b3bc69c0e180b758747b8caa5a3472f54c954 | |
| parent | f39e10ca57a404f36a9657527969720a1b61b3d6 (diff) | |
sleepwalk: Inhibit suspend on hotspot or BT connected
| -rwxr-xr-x | sleepwalk | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 |
