Created
April 9, 2019 12:22
-
-
Save danielpunkass/df0d72be11b8956f2ef4f4d52cce7a41 to your computer and use it in GitHub Desktop.
Standalone tool using private Apple framework to toggle display grayscale mode
This file contains 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 <stdio.h> | |
// Compile with cc -o gray gray.c -framework UniversalAccess -F /System/Library/PrivateFrameworks | |
extern void UAGrayscaleSetEnabled(int isEnabled); | |
extern int UAGrayscaleIsEnabled(); | |
int main() { | |
UAGrayscaleSetEnabled(!UAGrayscaleIsEnabled()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Want to avoid private framework ? You can do this using private API from public framework (I'm using it since 10.3 at least):