diff --git a/split_man b/split_man new file mode 100755 index 0000000..15e425b --- /dev/null +++ b/split_man @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Check if gum is available +if ! test -x "$(command -v gum)"; then + echo "Missing dependency: gum" + echo "See https://github.com/charmbracelet/gum" + exit 1 +fi + +CMD=$(gum input --placeholder="command") + +if [[ -n "$BYOBU_BACKEND" && "$BYOBU_BACKEND" = "tmux" ]]; then + byobu-tmux split-window -h man "$CMD" +elif [[ -n "$TMUX" ]]; then + tmux split-window -h man "$CMD" +elif [[ -n "$ZELLIJ" ]]; then + zellij action new-pane -- man "$CMD" +else + echo "No byobu, tmux, or Zellij sessions detected" + exit 1 +fi diff --git a/tman b/tman deleted file mode 100755 index cc0b74d..0000000 --- a/tman +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -CMD=$(gum input --placeholder="command") -tmux split-window -h man "$CMD" diff --git a/zman b/zman deleted file mode 100755 index be33957..0000000 --- a/zman +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env zsh - -CMD=$(gum input --placeholder="command") -zellij action new-pane -- man "$CMD"