tmux-thumbs/tmux-thumbs.sh

12 lines
424 B
Bash
Raw Normal View History

2019-02-04 21:40:45 +00:00
#!/usr/bin/env bash
2019-03-06 17:04:05 +00:00
source ~/.bash_profile
2019-03-09 22:39:16 +00:00
COMMAND="tmux-thumbs -a qwerty -r -u"
2019-03-05 08:10:41 +00:00
CURRENT_PANE_ID=$(tmux list-panes -F "#{pane_id}:#{?pane_active,active,nope}" | grep active | cut -d: -f1)
2019-03-09 22:39:16 +00:00
NEW_ID=$(tmux new-window -P -d -n "[thumbs]" ${COMMAND} --tmux-pane ${CURRENT_PANE_ID})
2019-03-06 15:13:49 +00:00
NEW_PANE_ID=$(tmux list-panes -a | grep ${NEW_ID} | grep --color=never -o '%[0-9]\+')
2019-03-05 08:10:41 +00:00
2019-03-06 15:13:49 +00:00
tmux swap-pane -d -s ${CURRENT_PANE_ID} -t ${NEW_PANE_ID}