![iterm2 download iterm2 download](https://miro.medium.com/max/552/1*sa1RQDC9a952bL-iWDRT0g.png)
# For other focus change events, do nothing Window = app.get_window_by_id(update.window_changed.window_id) # For window change events, use the provided event reason Tab = app.get_tab_by_id(lected_tab_changed.tab_id)
![iterm2 download iterm2 download](https://shareyellow.weebly.com/uploads/1/2/5/0/125045795/246370354.png)
# When switching to a new tab, treat as selecting a window
#Iterm2 download update
Update = await mon.async_get_next_update() Original = await _get(Ĭt_transparency(ansparency)Īwait session.async_set_profile_properties(change)Īpp = await iterm2.async_get_app(connection)Īwait update_tab_transparency(connection, tab, reason)Īsync with iterm2.FocusMonitor(connection) as mon: # But, only need to do anything if the profile has been changed # make sure transparency matches the original profile # For window change events taking a window out of focus, # For window change events bringing a window into focus, Profile = await session.async_get_profile() Window_selected = Īsync def update_tab_transparency(connection, tab, reason): # Store window change event reason objects in more convenient variables To get the desired behavior (change transparency based on window focus), you need to write a script using iTerm2's Python API, and save it as an AutoLaunch script: #!/usr/bin/env python3.7
#Iterm2 download windows
One changes transparency, but is static the other dims when windows are inactive, rather than changes transparency. Fixed and refactored :)Įach of the previous answers gets a piece of the puzzle. Edit: was a bug in the original script versions, and they weren't handling the case of multiple sessions in a tab.