Created
August 13, 2024 11:32
-
-
Save cgsdev0/c5fd87b0213992bd50194f315296dc98 to your computer and use it in GitHub Desktop.
bash script for https://github.com/cgsdev0/termsand
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
popup() { | |
TMP="$(mktemp)" | |
trap "rm $TMP" EXIT | |
cat > "$TMP" | |
tmux display-popup -w $WIDTH -h $HEIGHT $* "cat \"$TMP\" | termsand" | |
} | |
PANE=$(tmux display -p "#{pane_id}") | |
DIMENSIONS="$(tmux display -p "#{pane_width}x#{pane_height}")" | |
POSITION="$(tmux display -p "#{pane_left}x#{pane_top}")" | |
HEIGHT="${DIMENSIONS#*x}" | |
WIDTH="${DIMENSIONS%x*}" | |
Y="${POSITION#*x}" | |
((Y+=HEIGHT+1)) | |
X="${POSITION%x*}" | |
STUFF="$(tmux capture-pane -p -e -t "$PANE")" | |
echo -e "$STUFF" \ | |
| popup -E -B -y$Y -x$X -w $WIDTH -h $HEIGHT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment