Skip to content

Instantly share code, notes, and snippets.

@MartiUK
Last active August 29, 2015 14:17
Show Gist options
  • Save MartiUK/6c2503a57680e4873e2a to your computer and use it in GitHub Desktop.
Save MartiUK/6c2503a57680e4873e2a to your computer and use it in GitHub Desktop.
Morning Job

/etc/systemd/system/goodmorning.timer

[Unit]
Description=Morning

[Timer]
OnCalendar=*-*-* 7:00
WakeSystem=true

[Install]
WantedBy=multi-user.target

/etc/systemd/system/goodmorning.service

[Unit]
Description=Morning!
RefuseManualStart=true
RefuseManualStop=true
ConditionACPower=true

[Service]
Type=oneshot
ExecStart=/bin/systemd-inhibit --what=handle-lid-switch --why=goodmorning /bin/su marty -c "/usr/bin/timeout 45m /home/marty/bin/goodmorning"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment