Hi Adrian,
thanks for the quick reply!
It would be nice to have a shortcut in the Status Bar for that ;-)
I also found a scripting solution, which implies creating a different script for each color profile: the advantage is that it is fewer clicks away: "Scripts-->script_name.py".
Here's an example script I made by copy-paste from the examples.
I called it "light_background.py":
#!/usr/bin/env python3
import iterm2
async def SetPresetInSession(connection, session, preset_name):
preset = await iterm2.ColorPreset.async_get(connection, preset_name)
if not preset:
return
profile = await session.async_get_profile()
if not profile:
return
await profile.async_set_color_preset(preset)
async def main(connection):
app = await iterm2.async_get_app(connection)
session = app.current_terminal_window.current_tab.current_session
await SetPresetInSession(connection, session, 'Light Background')
iterm2.run_until_complete(main)