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_layout=~/.local/share/tmux/layouts/session-$session_name
|
||||
if [ -f $session_layout ]; then
|
||||
tmux source-file $session_layout
|
||||
$session_layout
|
||||
else
|
||||
tmux rename-window home
|
||||
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
|
||||
rename-window config/nvim
|
||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||
tmux new-window -c ~/.config/nvim
|
||||
tmux rename-window config/nvim
|
||||
`dirname $0`/window-auto
|
||||
|
||||
new-window -c ~/.config/zsh
|
||||
rename-window config/zsh
|
||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||
tmux new-window -c ~/.config/zsh
|
||||
tmux rename-window config/zsh
|
||||
`dirname $0`/window-auto
|
||||
|
||||
new-window -c ~/.config/tmux
|
||||
rename-window config/tmux
|
||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||
tmux new-window -c ~/.config/tmux
|
||||
tmux rename-window config/tmux
|
||||
`dirname $0`/window-auto
|
||||
|
||||
new-window -c ~/.config/local
|
||||
rename-window config/local
|
||||
move-window -s local:config/local -t 9
|
||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||
tmux new-window -c ~/.config/local
|
||||
tmux rename-window config/local
|
||||
tmux move-window -s local:config/local -t 9
|
||||
`dirname $0`/window-auto
|
||||
|
||||
select-window -t local:home
|
||||
|
||||
# vim: ft=tmux
|
||||
tmux select-window -t local:home
|
||||
|
@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env -S tmux source-file
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
rename-session main
|
||||
rename-window home
|
||||
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||
|
||||
# vim: ft=tmux
|
||||
tmux rename-session main
|
||||
tmux rename-window home
|
||||
`dirname $0`/window-auto
|
||||
|
@ -1,13 +1,11 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
cols=`tput cols`
|
||||
lines=`tput lines`
|
||||
cols=`tmux display -p "#{pane_width}"`
|
||||
lines=`tmux display -p "#{pane_height}"`
|
||||
width=$(( $cols / 2 )).0
|
||||
height=$lines.0
|
||||
ratio=$(( ($width / $height) * 100 ))
|
||||
|
||||
# echo "size: ( $width,$height ) ratio: $ratio"
|
||||
|
||||
if [[ $cols -lt 140 ]] && [[ $lines -lt 70 ]]; then
|
||||
# terminal is too small
|
||||
exit
|
||||
@ -15,7 +13,7 @@ fi
|
||||
|
||||
if [[ $ratio -ge 100 ]]; then
|
||||
# terminal is wide or square
|
||||
if [[ `tput cols` -gt 230 ]]; then
|
||||
if [[ $cols -gt 230 ]]; then
|
||||
# terminal is wide and large
|
||||
`dirname $0`/window-wide-right
|
||||
else
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/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
|
||||
|
||||
# vim: ft=tmux
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/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
|
||||
|
||||
# vim: ft=tmux
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/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
|
||||
|
||||
# vim: ft=tmux
|
||||
|
Loading…
x
Reference in New Issue
Block a user