Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Show image from URL in TMux pane with Ueberzeugt
#!/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