From 641ea1557ccc0099ef5471a16503938bd00924af Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sat, 20 Jun 2020 21:04:14 -0700 Subject: larger fonts for laptop --- bin/tmux-send | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 bin/tmux-send (limited to 'bin') diff --git a/bin/tmux-send b/bin/tmux-send new file mode 100755 index 0000000..47a6de8 --- /dev/null +++ b/bin/tmux-send @@ -0,0 +1,37 @@ +#!/bin/sh + +dir=$1 +tty=$(tmux list-panes -F "#{pane_active}#{pane_tty}" | grep '^1' | cut -c2-) +vim=$(ps -o stat=,command= -t $tty | awk 'BEGIN{flag=0} {if($1 ~ /S*+/ && $2 ~ /nvim/){flag +=1}}; END {print flag}') + +if [ $vim -gt 0 ]; then + case $dir in + up) + tmux send-keys C-k + ;; + down) + tmux send-keys C-j + ;; + left) + tmux send-keys C-h + ;; + right) + tmux send-keys C-l + ;; + esac +else + case $dir in + up) + tmux select-pane -U + ;; + down) + tmux select-pane -D + ;; + left) + tmux select-pane -L + ;; + right) + tmux select-pane -R + ;; + esac +fi -- cgit v1.2.1