aboutsummaryrefslogtreecommitdiff
path: root/tmux/.local/bin/tmux-menu.sh
blob: 8b8f928a4d84f6d4543e6cd2da9050869c60907f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
PROJECTS_DIRS="$HOME/Documents/Projects $HOME/Documents/Projects/hp"

SELECTED=$({ for dir in $PROJECTS_DIRS; do ls $dir; done; } | dmenu)

for dir in $PROJECTS_DIRS; do
  FULL_PATH=$(find -L $dir -maxdepth 1 -type d -name $SELECTED)
  if [ -n "$FULL_PATH" ]; then
    tmux new-session -s $SELECTED -c $FULL_PATH \; send-keys "nvim" Enter \; split-window -h \; rename-window editor
    break
  fi
done;