[Unit] Description=Inhibit sleep for some period of time [Service] Type=exec Environment=TIME=%I ExecStartPre=-pkill -f -SIGUSR1 '^(.*/)?emacs +-Q +--script +(.*/)?sb-manual-sleep-locks( +.+)?$' ExecStart=systemd-inhibit --what=sleep:idle "--who=manual-inhibit-sleep@%I.service" --mode=block "--why=User manually inhibited sleep" sleep $TIME ExecStopPost=-pkill -f -SIGUSR1 '^(.*/)?emacs +-Q +--script +(.*/)?sb-manual-sleep-locks( +.+)?$' [Install] WantedBy=default.target