aboutsummaryrefslogtreecommitdiff
path: root/scripts/scripts/tmux-fzf.sh
blob: cda0ec5ca12b3564888d0dee55a6b4a2fe95b292 (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