- if $cron && DISPLAY=:0 xprintidle; then
- # This is a separate ssh because xprintidle can fail and thats ok.
- # Ignore this host. i sometimes use a non-main machine for testing or web browsing, knowing that
- # everything will be wiped by the next backup, but I dont want it to happen as Im using
- # it from cronjob.
- continue
+ # This is a separate ssh because xprintidle can fail and thats ok.
+ if $cron && idle_ms=$(ssh $h DISPLAY=:0 xprintidle); then
+ if (( idle_ms < min_idle_ms )); then
+
+ # Ignore this host. i sometimes use a non-main machine for
+ # testing or web browsing, knowing that everything will be wiped
+ # by the next backup, but I dont want it to happen as Im using
+ # it from cronjob.
+ e "warning: $h: active X session in the last 15 minutes, skipping for now"
+ continue
+ fi