Is there anyway by which one can have grayscale system wide except some selected (by user) apps, on macOS?
MacOS grayscale except some apps
accessibilitycolormacos
accessibilitycolormacos
Is there anyway by which one can have grayscale system wide except some selected (by user) apps, on macOS?
Best Answer
Yes, this is possible, though my solution is a bit hacky. Note that this method uses some undocumented Objective C APIs, and doesn't go through ordinary accessibility settings, so be careful.
First you need to have developer tools installed so that you can compile Objective C code. Then compile two commands
enable-grayscale
anddisable-grayscale
from source (based on this StackOverflow answer which provides some additional ways of doing this).Then compile them into commands:
Put the resulting files somewhere you want to run them, e.g. your home directory.
Now install Hammerspoon. You'll need to give it accessibility access in System Preferences. Within Hammerspoon, select "Open Config", and modify the Lua code to do what you want. My configuration is below, based on this example from their docs:
That's the configuration I chose (turn on grayscale for Firefox, but leave it off for all other applications). Whenever Firefox is focused, the whole screen becomes grayscale. When other applications are focused, it's color. It sounds like you'd want the opposite: grayscale turned on in System Preferences, with it being disabled when you focus an app from the list you're interested in. Once you've configured it as you want, click "Reload Config" to activate the changes.