.dotfiles/.config/wofi/scripts/open-project

20 lines
449 B
Plaintext
Raw Normal View History

2022-05-24 14:48:23 +02:00
#!/bin/bash
PROJECTS="$(ls -t $HOME/.local/share/nvim/sessions)"
NAME="$(echo "$PROJECTS" | sed 's/.*\%//' | sed 's/\.vim//g' | wofi --show dmenu -i)"
PROJECT="$(echo "$PROJECTS" | grep "$NAME.vim" | sed 's/\%/\//g' | sed 's/\.vim$//')"
2022-06-09 19:29:23 +02:00
VIM="$HOME/.asdf/shims/nvim ; zsh";
2022-05-24 14:48:23 +02:00
if [ "$PROJECT" != "" ]; then
2022-06-09 19:29:23 +02:00
if [ "$(pgrep kitty)" == "" ]; then
kitty -d $PROJECT $VIM
exit
else
cd $PROJECT
tmux new-window "$VIM"
exit
fi
2022-05-24 14:48:23 +02:00
fi