Integrate scripts into home-manager

This commit is contained in:
2026-04-07 18:37:17 +02:00
parent 5403b4988e
commit d7332f3cc6
5 changed files with 300 additions and 0 deletions

23
scripts/tmux-sessionizer Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env zsh
selected=$(find ~/projects -maxdepth 1 -mindepth 1 | fzf)
if [[ -z "$selected" ]]; then
exit 0
fi
selected_name=$(basename $selected | tr ".,: " "____")
switch_to() {
if [[ -z "$TMUX" ]]; then
tmux attach-session -t $selected_name
else
tmux switch-client -t $selected_name
fi
}
if tmux has-session -t="$selected_name"; then
switch_to
else
tmux new-session -ds $selected_name -c $selected
tmux send-keys -t $selected_name "tmux-setup" ^M
switch_to
fi