Compare commits
2 Commits
b9a82c93d9
...
23360f235f
Author | SHA1 | Date | |
---|---|---|---|
23360f235f | |||
150c13ab31 |
@ -4,16 +4,20 @@ rename-window home
|
|||||||
|
|
||||||
new-window -c ~/.config/nvim
|
new-window -c ~/.config/nvim
|
||||||
rename-window config/nvim
|
rename-window config/nvim
|
||||||
|
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||||
|
|
||||||
new-window -c ~/.config/zsh
|
new-window -c ~/.config/zsh
|
||||||
rename-window config/zsh
|
rename-window config/zsh
|
||||||
|
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||||
|
|
||||||
new-window -c ~/.config/tmux
|
new-window -c ~/.config/tmux
|
||||||
rename-window config/tmux
|
rename-window config/tmux
|
||||||
|
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||||
|
|
||||||
new-window -c ~/.config/local
|
new-window -c ~/.config/local
|
||||||
rename-window config/local
|
rename-window config/local
|
||||||
move-window -s local:config/local -t 9
|
move-window -s local:config/local -t 9
|
||||||
|
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||||
|
|
||||||
select-window -t local:home
|
select-window -t local:home
|
||||||
|
|
||||||
|
@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
rename-session main
|
rename-session main
|
||||||
rename-window home
|
rename-window home
|
||||||
|
run-shell '~/.local/share/tmux/layouts/window-auto'
|
||||||
|
|
||||||
# vim: ft=tmux
|
# vim: ft=tmux
|
||||||
|
28
layouts/window-auto
Executable file
28
layouts/window-auto
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
cols=`tput cols`
|
||||||
|
lines=`tput lines`
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $ratio -ge 100 ]]; then
|
||||||
|
# terminal is wide or square
|
||||||
|
if [[ `tput cols` -gt 230 ]]; then
|
||||||
|
# terminal is wide and large
|
||||||
|
`dirname $0`/window-wide-right
|
||||||
|
else
|
||||||
|
# terminal is wide and small
|
||||||
|
tmux split-window -h -l 50%
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# terminal is tall
|
||||||
|
`dirname $0`/window-tall
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user