Last active
June 26, 2019 13:10
-
-
Save DazWorrall/a83d9fb49ebd0dd0bd7a8291891585c5 to your computer and use it in GitHub Desktop.
Figuring out kitty stack layout with borders
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
def main(args): | |
pass | |
def enable_borders(tab): | |
tm = tab.tab_manager_ref() | |
if tm is None: | |
return | |
w = tab.active_window | |
tab.borders( | |
[w], w, tab.current_layout, tm.blank_rects, True | |
) | |
def handle_result(args, answer, target_window_id, boss): | |
tab = boss.active_tab | |
if tab is not None: | |
if tab.current_layout.name == 'stack': | |
tab.last_used_layout() | |
tab.enabled_layouts.remove('stack') | |
else: | |
tab.enabled_layouts.append('stack') | |
tab.goto_layout('stack') | |
enable_borders(tab) | |
handle_result.no_ui = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment