mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-25 10:23:42 +01:00
+ split_man
This commit is contained in:
parent
23916be066
commit
0b91239209
21
split_man
Executable file
21
split_man
Executable file
@ -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
|
4
tman
4
tman
@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CMD=$(gum input --placeholder="command")
|
||||
tmux split-window -h man "$CMD"
|
Loading…
Reference in New Issue
Block a user