~tim/ubuntu_on_surface_go

ubuntu_on_surface_go/hibernate_when_inactive.sh -rwxr-xr-x 167 bytes View raw
f77d614fTim Morgan Simplify suspend/hibernate notes 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
#!/bin/bash

idle=$(xprintidle)
timeout=$((10 * 60 ** 1000)) # 10 minutes

if (( $idle > $timeout )) && xset -q | grep "Monitor is Off"; then
  systemctl hibernate
fi