Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created December 26, 2014 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tlrobinson/cd4dbc3ce28612cd51d3 to your computer and use it in GitHub Desktop.
Save tlrobinson/cd4dbc3ce28612cd51d3 to your computer and use it in GitHub Desktop.
Mac OS X mute at night, unmute in the morning
launchctl load ~/Library/LaunchAgents/net.tlrobinson.mute.plist
launchctl load ~/Library/LaunchAgents/net.tlrobinson.unmute.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.tlrobinson.mute</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>-e</string>
<string>set volume with output muted</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>21</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.tlrobinson.unmute</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>-e</string>
<string>set volume without output muted</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>921</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment