Add tmux fuzzy session attach

This commit is contained in:
Talia 2024-10-21 10:56:49 +02:00
parent 287ede88a8
commit ac93ce1b91
2 changed files with 14 additions and 0 deletions

13
bin/tmux-fzf Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
case $1 in
ssh) ssh_host=$2
esac
if [ -n "$ssh_host" ]
then
target="$(ssh $ssh_host tmux ls | cut -d : -f 1 | fzf)"
[ -n "$target" ] && ssh $ssh_host -t tmux a -t "$target"
else
target="$(tmux ls | cut -d : -f 1 | fzf)"
[ -n "$target" ] && tmux a -t "$target"
fi

View file

@ -20,6 +20,7 @@ alias setclip='xclip -selection c'
alias tmux='tmux -2'
alias w='watch -t -d -n 1'
alias wmu='wake-me-up'
alias tmfa='tmux-fzf'
bat_theme() {
if [ -e $HOME/.dark ]