aboutsummaryrefslogtreecommitdiff
path: root/find-file/split.sh
blob: 77a6670bbee039b22eb743cf6374822ab3b1bff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash

width=$(tmux display -p "#{pane_width}")
height=$(tmux display -p "#{pane_height}")

if (( $(echo "$width / $height > 2.5" | bc -l) )); then
  tmux split-window -h "$@"
else
  tmux split-window -v "$@"
fi