Skip to content

Instantly share code, notes, and snippets.

View erikw's full-sized avatar

Erik Westrup erikw

View GitHub Profile
erikw /
Last active November 29, 2021 18:33 — forked from jamesmacfie/
iTerm 2 - script to change theme depending on Mac OS dark mode
#!/usr/bin/env python3
import asyncio
import iterm2
async def main(connection):
async with iterm2.VariableMonitor(connection, iterm2.VariableScopes.APP, "effectiveTheme", None) as mon:
while True:
# Block until theme changes
theme = await mon.async_get()