Last active
January 22, 2019 16:15
-
-
Save quad/43270ecb66dcacba8048fddc7c86225d to your computer and use it in GitHub Desktop.
Make macOS (OSX) Greyscale from the terminal (CLI)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tgray: tgray.c | |
| clang -g -std=c11 -Wall -framework ApplicationServices $^ -o $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ApplicationServices/ApplicationServices.h> | |
| CG_EXTERN bool CGDisplayUsesForceToGray(void); | |
| CG_EXTERN void CGDisplayForceToGray(bool forceToGray); | |
| int main(int argc, const char** argv) | |
| { | |
| CGDisplayForceToGray(!CGDisplayUsesForceToGray()); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment