Last active
December 24, 2015 07:59
-
-
Save qtip/6767625 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
from sh import tmux | |
curwin = tmux('display-message', p='#{window_index}').strip() | |
windows = [line.split()[0].strip(':') for line in tmux('list-windows')] | |
for src, dest in zip(windows, range(1, len(windows)+1)): | |
if str(src) == str(curwin): | |
curwin = dest | |
if str(dest) != str(src): | |
tmux('move-window', s=src, t=dest) | |
tmux('select-window', t=curwin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment