aboutsummaryrefslogtreecommitdiff
path: root/scripts/scripts/tmux-fzf.sh
blob: 9caa7ea674a73ff28d98d4b857dee29406a35d7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /usr/bin/env bash

function __fzf() {
    fzf --cycle --height 7 --reverse
}

function __list_to_fzf() {
    tmux ls -F "#{session_name}" | __fzf
}

if [ -n "$TMUX" ]; then
    tmux switch-client -t "$(__list_to_fzf)"
else
    tmux a -dt "$(tmux ls -F "#{session_name}" | __fzf)"
fi