[Unit] Description=Execute events on X11 idle StartLimitBurst=5 StartLimitIntervalSec=600 [Service] Type=simple IOWeight=60 CPUQuota=60% RestartSec=5 Restart=always SyslogIdentifier=events-idle ExecStartPre=/usr/bin/env sh -c '%h/.local/bin/scripts/events-idle' ExecStart=/usr/bin/env sh -c 'while true; do sleep 300 && [ "$(xprintidle)" -gt 120000 ] && %h/.local/bin/scripts/events-idle; done' [Install] WantedBy=default.target