Assorted shell and Python scripts
1#!/usr/bin/env bash
2
3# Check if gum is available
4if ! command -v gum >/dev/null; then
5 echo "Missing dependency: gum"
6 echo "See https://github.com/charmbracelet/gum"
7 exit 1
8fi
9
10CMD=$(gum input --placeholder="command")
11
12if [[ -n "$BYOBU_BACKEND" && "$BYOBU_BACKEND" = "tmux" ]]; then
13 byobu-tmux split-window -h man "$CMD"
14elif [[ -n "$TMUX" ]]; then
15 tmux split-window -h man "$CMD"
16elif [[ -n "$ZELLIJ" ]]; then
17 zellij action new-pane -- man "$CMD"
18else
19 echo "No byobu, tmux, or Zellij sessions detected"
20 exit 1
21fi