1#!/bin/sh
2# skip suspend while an incoming ssh session is established
3# (hypridle refires this listener every 1200s while idle, so it retries
4# once the ssh connection drops)
5ss -H -tn state established '( sport = :22 )' | grep -q . && exit 0
6systemctl suspend