![]() ![]() # 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) # When switching to a new tab, treat as selecting a window 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 ![]() One changes transparency, but is static the other dims when windows are inactive, rather than changes transparency. ![]() Check out the repo for the up-to-date scripts.Įach of the previous answers gets a piece of the puzzle. Update: I put the two scripts up on GitHub, along with a nice demo GIF :)Īlso did a bit of refactor and bug fixing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |