Created
April 15, 2012 15:23
-
-
Save judu/2393406 to your computer and use it in GitHub Desktop.
Pack the tmux windows, keeping the order.
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
#!/bin/bash | |
# you can use it from tmux | |
# bind-key P run repack-tmux | |
ttt () { | |
local bef=-1 | |
for i in `tmux list-windows | cut -d':' -f1`; do | |
local b=$(($bef + 1)) | |
if [ $b -lt $i ]; then | |
tmux move-window -s $i -t $b | |
bef=$b | |
else | |
bef=$i | |
fi | |
done | |
} | |
ttt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment