Skip to content

Instantly share code, notes, and snippets.

@quad
Last active January 22, 2019 16:15
Show Gist options
  • Select an option

  • Save quad/43270ecb66dcacba8048fddc7c86225d to your computer and use it in GitHub Desktop.

Select an option

Save quad/43270ecb66dcacba8048fddc7c86225d to your computer and use it in GitHub Desktop.
Make macOS (OSX) Greyscale from the terminal (CLI)
tgray: tgray.c
clang -g -std=c11 -Wall -framework ApplicationServices $^ -o $@
#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