Last active
March 6, 2021 14:17
-
-
Save weilbith/5b2e19c4bf807518f1b677e7e3fd56cc to your computer and use it in GitHub Desktop.
Show image from URL in TMux pane with Ueberzeugt
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 | |
image_url=$1 | |
download_path=$(mktemp --suffix "tmux-preview-image") | |
max_width=$(tmux display -p '#{pane_width}') | |
max_height=$(tmux display -p '#{pane_height}') | |
curl --output $download_path --silent $image_url | |
source $(ueberzug library) | |
ImageLayer 0< <( | |
ImageLayer::add [identifier]="tmux-preview-image" [x]="0" [y]="0" [max_width]="$max_width" [max_height]="$max_height" [path]="$download_path" | |
read | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment