- Add
switch_automatic.py
to~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch
with:
#!/usr/bin/env python3
import asyncio
import iterm2
async def main(connection):
async with iterm2.VariableMonitor(connection, iterm2.VariableScopes.APP, "effectiveTheme", None) as mon: