diff --git a/scripts/td b/scripts/td index 1954a95..6b65124 100755 --- a/scripts/td +++ b/scripts/td @@ -1,2 +1,2 @@ -#!/bin/zsh +#!/bin/sh node ~/git/td/dist/cli.js diff --git a/scripts/tmux-td b/scripts/tmux-td index 07ab828..c173bea 100755 --- a/scripts/tmux-td +++ b/scripts/tmux-td @@ -1,13 +1,8 @@ -#!/bin/zsh +#!/bin/sh -if ! tmux has-session -t td-cli 2>/dev/null; then - tmux setenv -g TD_TASK_DIR ~/git/tasks/ - tmux new-session -d -s td-cli ~/installs/scripts/td -fi - -if [[ "$(tmux display-message -p -F "#{session_name}")" == "td-cli" ]]; then - tmux detach-client - tmux display-popup -C +# Check if Zsh is available +if command -v zsh >/dev/null 2>&1; then + zsh scripts/tmux-td-zsh else - tmux display-popup -d -C -E -w90% -h90% 'tmux attach-session -x -f wait-exit -t td-cli' + bash scripts/tmux-td-bash fi diff --git a/scripts/tmux-td-bash b/scripts/tmux-td-bash new file mode 100755 index 0000000..0a3b794 --- /dev/null +++ b/scripts/tmux-td-bash @@ -0,0 +1,13 @@ +#!/bin/bash + +if ! tmux has-session -t td-cli 2>/dev/null; then + tmux setenv -g TD_TASK_DIR ~/git/tasks/ + tmux new-session -d -s td-cli /home/omnissiah/installs/scripts/td +fi + +if [ "$(tmux display-message -p -F "#{session_name}")" = "td-cli" ]; then + tmux detach-client + tmux display-popup -C +else + tmux display-popup -d -C -E -w90% -h90% 'tmux attach-session -x -t td-cli' +fi diff --git a/scripts/tmux-td-zsh b/scripts/tmux-td-zsh new file mode 100755 index 0000000..07ab828 --- /dev/null +++ b/scripts/tmux-td-zsh @@ -0,0 +1,13 @@ +#!/bin/zsh + +if ! tmux has-session -t td-cli 2>/dev/null; then + tmux setenv -g TD_TASK_DIR ~/git/tasks/ + tmux new-session -d -s td-cli ~/installs/scripts/td +fi + +if [[ "$(tmux display-message -p -F "#{session_name}")" == "td-cli" ]]; then + tmux detach-client + tmux display-popup -C +else + tmux display-popup -d -C -E -w90% -h90% 'tmux attach-session -x -f wait-exit -t td-cli' +fi