mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 11:24:55 +02:00
24 lines
641 B
Bash
Executable file
24 lines
641 B
Bash
Executable file
#!/usr/bin/env bash
|
|
BASE_PATH=$(dirname $(readlink -f $BASH_SOURCE))
|
|
source ${BASE_PATH}/helpers.sh
|
|
source ${BASE_PATH}/.env
|
|
|
|
# Scripts
|
|
LIST_SESSIONS_SCRIPT=${BASE_PATH}/list-sessions.sh
|
|
KILL_SCRIPT=${BASE_PATH}/kill.sh
|
|
|
|
|
|
if [[ $# -eq 1 ]]; then
|
|
if [[ "$1" == "-a" ]]; then
|
|
selected=$($LIST_SESSIONS_SCRIPT | $FZF --bind "ctrl-d:execute(${KILL_SCRIPT} {})+reload(${LIST_SESSIONS_SCRIPT})" \
|
|
--border-label=Session | get_session_name)
|
|
if [ ! -z "$selected" ]; then
|
|
${BASE_PATH}/new.sh $selected
|
|
fi
|
|
else
|
|
${BASE_PATH}/new.sh $(realpath $1)
|
|
fi
|
|
else
|
|
${BASE_PATH}/new.sh
|
|
fi
|
|
|