Created
March 15, 2025 12:35
-
-
Save fxn/ae193eab1db2402eaea5c72e8ff01305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import iterm2 | |
import sys | |
async def main(connection): | |
app = await iterm2.async_get_app(connection) | |
session = app.current_terminal_window.current_tab.current_session | |
change = iterm2.LocalWriteOnlyProfile() | |
change.set_background_image_location("") | |
await session.async_set_profile_properties(change) | |
iterm2.run_until_complete(main) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import iterm2 | |
import sys | |
async def main(connection): | |
app = await iterm2.async_get_app(connection) | |
session = app.current_terminal_window.current_tab.current_session | |
change = iterm2.LocalWriteOnlyProfile() | |
change.set_background_image_location(sys.argv[1]) | |
# ASPECT_FIT is "Scale to fit the space, adding letterboxes or pillarboxes if needed. Does not distort." | |
change.set_background_image_mode(iterm2.BackgroundImageMode.ASPECT_FIT) | |
change.set_blur(False) | |
change.set_blend(1) | |
await session.async_set_profile_properties(change) | |
iterm2.run_until_complete(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment