Skip to content

Commit bfe3a80

Browse files
committed
window: Keep grep/cut as a backup in case (and to show variety)
c68ca72
1 parent c68ca72 commit bfe3a80

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

manuscript/06-window.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,21 @@ Layouts can also be custom. To get the custom layout snippet for your current
141141
window, try this:
142142

143143
{language=shell, line-numbers=off}
144+
# awk(1)
144145
$ tmux lsw -F "#{window_active} #{window_layout}" | awk '$1{print $2}'
145146

147+
# grep(1) + cut(1)
148+
$ tmux lsw -F "#{window_active} #{window_layout}" | grep "^1" | cut -d " " -f2
149+
146150
To apply this layout:
147151

148152
{language=shell, line-numbers=off}
149153
$ tmux lsw -F "#{window_active} #{window_layout}" | awk '$1{print $2}'
150154
> 5aed,176x79,0,0[176x59,0,0,0,176x19,0,60{87x19,0,60,1,88x19,88,60,2}]
151155

156+
# Alternant to above:
157+
$ tmux lsw -F "#{window_active} #{window_layout}" | grep "^1" | cut -d " " -f2
158+
152159
# resize your panes or try doing this in another window to see the outcome
153160
$ tmux select-layout "5aed,176x79,0,0[176x59,0,0,0,176x19,0,60{87x19,0,60,1,88x19,88,60,2}]"
154161

0 commit comments

Comments
 (0)