Added tmux conf and script

This commit is contained in:
2023-11-24 18:03:30 +01:00
parent a52725e7ea
commit 679415792e
3 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env zsh
selected=$(find ~/ -mindepth 2 -maxdepth 2 -type d | fzf)
selected_name=$(basename "$selected" | tr . _)
tmux has-session -t=$selected_name 2> /dev/null
if [[ $? -ne 0 ]]; then
TMUX='' tmux new-session -d -s "$selected_name" -c "$selected"
fi
if [[ -z "$TMUX" ]]; then
tmux attach -t "$selected_name"
else
tmux switch-client -t "$selected_name"
fi