Skip to content

Instantly share code, notes, and snippets.

@jamonholmgren
Created August 2, 2016 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamonholmgren/25e6021e878fc0e2c6d78f26b2b77edb to your computer and use it in GitHub Desktop.
Save jamonholmgren/25e6021e878fc0e2c6d78f26b2b77edb to your computer and use it in GitHub Desktop.
zsh function script to toggle Do Not Disturb mode on a Mac from terminal/command line
# zsh function script to toggle DND on a Mac
function dnd () {
osascript -e "
tell application \"System Events\" to tell process \"SystemUIServer\"
key down option
click menu bar item 1 of menu bar 2
key up option
end tell
"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment