Files
dotfiles/script/t
T
steveandgitadmin 02a5e0df28 init: new dotfile configuration
Remove all org files using a new script to more config over, The old org
file configuaration were great but required org. This new version only
requires the scripts that is included in the repo.

The configuration are all done but have not ported the theming system
yet.

Signed-off-by: Steve Beaulac <steve@sagacity.ca>
Change-Id: I14cd7fe058a71c8ba9d6d35397dc8d7e6a6a6964
2026-03-02 13:26:21 -05:00

39 lines
853 B
Bash
Executable File

#!/bin/sh
# determine if the tmux server is running
if [ "$TMUX" ]; then
FZF="fzf-tmux"
else
FZF="fzf"
fi
if [ -z "$1" ]; then
ZOXIDE_RESULT=$(zoxide query -l | $FZF --reverse)
elif [ x"." == x"$1" ]; then
ZOXIDE_RESULT=$PWD
else
ZOXIDE_RESULT=$(zoxide query $1)
fi
if [ -z "$ZOXIDE_RESULT" ]; then
exit 0
fi
FOLDER=$(echo $ZOXIDE_RESULT | awk 'BEGIN{FS="/"} { print $(NF-1)"_"$NF }' | tr '. ' '_')
SESSION=$(tmux list-sessions | grep $FOLDER | awk -F: '{print $1}')
if [ -z "$TMUX" ]; then
if [ -z "$SESSION" ]; then
cd $ZOXIDE_RESULT
tmux new-session -s $FOLDER
else
tmux attach -t $SESSION
fi
else
if [ -z "$SESSION" ]; then
cd $ZOXIDE_RESULT
tmux new-session -d -s $FOLDER
tmux switch-client -t $FOLDER
else
tmux switch-client -t $SESSION
fi
fi