Fix window-auto when using in session layouts
This commit is contained in:
parent
14894bdf47
commit
2c859ddd93
@ -3,7 +3,7 @@
|
|||||||
session_name=$(tmux display-message -p '#S')
|
session_name=$(tmux display-message -p '#S')
|
||||||
session_layout=~/.local/share/tmux/layouts/session-$session_name
|
session_layout=~/.local/share/tmux/layouts/session-$session_name
|
||||||
if [ -f $session_layout ]; then
|
if [ -f $session_layout ]; then
|
||||||
tmux source-file $session_layout
|
$session_layout
|
||||||
else
|
else
|
||||||
tmux rename-window home
|
tmux rename-window home
|
||||||
fi
|
fi
|
||||||
|
@ -1,24 +1,23 @@
|
|||||||
#!/usr/bin/env -S tmux source-file
|
#!/usr/bin/zsh
|
||||||
|
|
||||||
rename-window home
|
tmux rename-window home
|
||||||
|
`dirname $0`/window-auto
|
||||||
|
|
||||||
new-window -c ~/.config/nvim
|
tmux new-window -c ~/.config/nvim
|
||||||
rename-window config/nvim
|
tmux rename-window config/nvim
|
||||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
`dirname $0`/window-auto
|
||||||
|
|
||||||
new-window -c ~/.config/zsh
|
tmux new-window -c ~/.config/zsh
|
||||||
rename-window config/zsh
|
tmux rename-window config/zsh
|
||||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
`dirname $0`/window-auto
|
||||||
|
|
||||||
new-window -c ~/.config/tmux
|
tmux new-window -c ~/.config/tmux
|
||||||
rename-window config/tmux
|
tmux rename-window config/tmux
|
||||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
`dirname $0`/window-auto
|
||||||
|
|
||||||
new-window -c ~/.config/local
|
tmux new-window -c ~/.config/local
|
||||||
rename-window config/local
|
tmux rename-window config/local
|
||||||
move-window -s local:config/local -t 9
|
tmux move-window -s local:config/local -t 9
|
||||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
`dirname $0`/window-auto
|
||||||
|
|
||||||
select-window -t local:home
|
tmux select-window -t local:home
|
||||||
|
|
||||||
# vim: ft=tmux
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env -S tmux source-file
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
rename-session main
|
tmux rename-session main
|
||||||
rename-window home
|
tmux rename-window home
|
||||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
`dirname $0`/window-auto
|
||||||
|
|
||||||
# vim: ft=tmux
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
cols=`tput cols`
|
cols=`tmux display -p "#{pane_width}"`
|
||||||
lines=`tput lines`
|
lines=`tmux display -p "#{pane_height}"`
|
||||||
width=$(( $cols / 2 )).0
|
width=$(( $cols / 2 )).0
|
||||||
height=$lines.0
|
height=$lines.0
|
||||||
ratio=$(( ($width / $height) * 100 ))
|
ratio=$(( ($width / $height) * 100 ))
|
||||||
|
|
||||||
# echo "size: ( $width,$height ) ratio: $ratio"
|
|
||||||
|
|
||||||
if [[ $cols -lt 140 ]] && [[ $lines -lt 70 ]]; then
|
if [[ $cols -lt 140 ]] && [[ $lines -lt 70 ]]; then
|
||||||
# terminal is too small
|
# terminal is too small
|
||||||
exit
|
exit
|
||||||
@ -15,7 +13,7 @@ fi
|
|||||||
|
|
||||||
if [[ $ratio -ge 100 ]]; then
|
if [[ $ratio -ge 100 ]]; then
|
||||||
# terminal is wide or square
|
# terminal is wide or square
|
||||||
if [[ `tput cols` -gt 230 ]]; then
|
if [[ $cols -gt 230 ]]; then
|
||||||
# terminal is wide and large
|
# terminal is wide and large
|
||||||
`dirname $0`/window-wide-right
|
`dirname $0`/window-wide-right
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env -S tmux source-file
|
#!/usr/bin/env -S tmux source-file
|
||||||
|
|
||||||
split-window -v -l 34%
|
split-window -v -l 34% -c '#{pane_current_path}'
|
||||||
select-pane -t 1
|
select-pane -t 1
|
||||||
|
|
||||||
# vim: ft=tmux
|
# vim: ft=tmux
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env -S tmux source-file
|
#!/usr/bin/env -S tmux source-file
|
||||||
|
|
||||||
split-window -h -l 43%
|
split-window -h -l 43% -c '#{pane_current_path}'
|
||||||
select-pane -t 1
|
select-pane -t 1
|
||||||
|
|
||||||
# vim: ft=tmux
|
# vim: ft=tmux
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env -S tmux source-file
|
#!/usr/bin/env -S tmux source-file
|
||||||
|
|
||||||
split-window -h -l 57%
|
split-window -h -l 57% -c '#{pane_current_path}'
|
||||||
select-pane -t 1
|
select-pane -t 1
|
||||||
|
|
||||||
# vim: ft=tmux
|
# vim: ft=tmux
|
||||||
|
Loading…
x
Reference in New Issue
Block a user