From 35e13a557fda411b0951304f0b67f1536acf62b4 Mon Sep 17 00:00:00 2001 From: Sky Kosiner Date: Wed, 30 Oct 2024 15:39:22 +0000 Subject: [PATCH] feat: Made folders more dynamic --- README.md | 10 +++++++++- tmux-sessionizer | 4 +--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ee449b9..3eea060 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,12 @@ tmux-sessionizer [] if you execute tmux-sessionizer without any parameters it will assume FZF and try to fuzzy find over a set of directories. -TODO: waiting on that directory list to be dynamic :) (go a head make pr if you want) +### Setup Directories +At the path `$XDG_CONFIG_HOME/tmux-sessionizer/directories` you can define all +the directories you want the script to look over. + +``` +~/ +~/personal +~/personal/dev/env/.config +``` diff --git a/tmux-sessionizer b/tmux-sessionizer index fa1bec5..8fa4153 100755 --- a/tmux-sessionizer +++ b/tmux-sessionizer @@ -22,9 +22,7 @@ hydrate() { if [[ $# -eq 1 ]]; then selected=$1 else - # If someone wants to make this extensible, i'll accept - # PR - selected=$(find ~/ ~/personal ~/personal/dev/env/.config -mindepth 1 -maxdepth 1 -type d | fzf) + selected=$(find $(eval echo $(xargs < "$XDG_CONFIG_HOME/tmux-sessionizer/directories")) -mindepth 1 -maxdepth 1 -type d | fzf) fi if [[ -z $selected ]]; then