Skip to content

Instantly share code, notes, and snippets.

@justincampbell
Created November 17, 2015 14:37
Show Gist options
  • Save justincampbell/869eb3331dde8ce96663 to your computer and use it in GitHub Desktop.
Save justincampbell/869eb3331dde8ce96663 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
ua=$(defaults read com.apple.universalaccess whiteOnBlack)
cg=$(defaults read com.apple.CoreGraphics DisplayUseInvertedPolarity)
if [ "$ua" != "$cg" ]; then
echo "Values do not match"
exit 1
fi
if [ "$ua" == "0" ]; then
new=1
else
new=0
fi
set -x
defaults write com.apple.universalaccess whiteOnBlack -int $new
defaults write com.apple.CoreGraphics DisplayUseInvertedPolarity -int $new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment