Last active
February 8, 2021 23:51
-
-
Save saagarjha/d43316472096b7eed22f55ad20f6dd0e to your computer and use it in GitHub Desktop.
Set the correct iTerm profile based on whether dark mode is enabled or not
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
// Compile with clang -F/System/Library/PrivateFrameworks -framework SkyLight iterm-set-profile.m | |
#import <Foundation/Foundation.h> | |
BOOL SLSGetAppearanceThemeLegacy(void); | |
int main() { | |
if (SLSGetAppearanceThemeLegacy()) { | |
printf("\033]50;SetProfile=Solarized Dark\a"); | |
} else { | |
printf("\033]50;SetProfile=Solarized Light\a"); | |
} | |
fflush(stdout); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment