A script to update the color presets used by iTerm when the System Preferences -> General -> Apperance setting changes (either manually or via Automator).
Inspired by https://gist.github.com/jamesmacfie/2061023e5365e8b6bfbbc20792ac90f8
- In iTerm2, in the menu bar go to Scripts > Manage > New Python Script
- Select Basic.
- Select Long-Running Daemon
- Give the script a decent name (I also chose
auto_dark_mode.py
) - Save and open the script in your editor of choice.
- Copy and paste the script below and save
- Go back to iTerm2, go to Scripts in the menu bar and select the script you just saved.
- Try toggling Dark mode to see what happens! Reminder it's under Appearance in the System Settings
Update the THEME_DARK
and THEME_LIGHT
variables at the top of the script.
After you change the script you'll have to restart the script if it's running already.
- Open the scipts maneger: Scripts -> Manage -> Console
- Click the script
auto_dark_mode
- Click the
Restart
button
Chose Scripts -> Manage -> Console at look at the latest log for auto_dark_mode