Skip to content

Instantly share code, notes, and snippets.

@jage
Last active October 15, 2021 09:33
Show Gist options
  • Save jage/da057caa29a89cb6d1bfd21e33886b06 to your computer and use it in GitHub Desktop.
Save jage/da057caa29a89cb6d1bfd21e33886b06 to your computer and use it in GitHub Desktop.
Ansible playbook to schedule display sleep (macOS/OS X)
---
- hosts: office-dashboard-terminal
become: yes
tasks:
- name: Ensure displays are up during office hours
cron:
name="Activate display"
minute="0"
hour="8"
weekday="1-5"
job="/usr/bin/pmset displaysleep 0"
- name: Ensure displays are down when no one is working
cron:
name="Disable display"
minute="0"
hour="18"
weekday="1-5"
job="/usr/bin/pmset displaysleep 1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment