mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Updated tmux-sessionator and tmux config
This commit is contained in:
@@ -2,10 +2,30 @@
|
||||
|
||||
# Adapted from: https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer
|
||||
|
||||
declare -a findPaths=("$HOME")
|
||||
|
||||
if [[ $# -eq 1 ]]; then
|
||||
selected=$1
|
||||
else
|
||||
selected=$(find ~/projects ~/ -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||
# Some of my machines, projects is a symlink to $REPOS, so ignore it.
|
||||
# On other machines, it is local versions of projects, so add it.
|
||||
if [[ ! -L "$HOME/projects" ]]; then
|
||||
findPaths+="$HOME/projects"
|
||||
fi
|
||||
|
||||
if [[ -d "$REPOS/github.com" ]]; then
|
||||
for dir in $(find "$REPOS/github.com" -mindepth 1 -maxdepth 1 -type d); do
|
||||
# prepends to the array.
|
||||
findPaths=($dir $findPaths)
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -d "$REPOS/local" ]]; then
|
||||
# prepends to the array.
|
||||
findPaths=("$REPOS/local" $findPaths)
|
||||
fi
|
||||
|
||||
selected=$(find -L "${(@)findPaths}" -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||
fi
|
||||
|
||||
if [[ -z $selected ]]; then
|
||||
|
||||
Reference in New Issue
Block a user