I've written a command line program in C that is invoked by shell scripts. The last API call in displayplacer instantly applies the desired changes but takes up to 10 seconds to return. How can I execute this line without waiting for the result? My intention is to invoke CGCompleteDisplayConfiguration()
and then exit the program immediately so that the following lines in the parent shell scripts are not unnecessarily paused for 10 seconds.
Something like this would be ideal:
isSuccess = someCode() && isSuccess;
CGCompleteDisplayConfiguration(configRef, kCGConfigurePermanently); //non-blocking
if (isSuccess) {
return 0;
} else {
return 1;
}