nixos/lf_preview.sh

9 lines
228 B
Bash
Executable file

#!/usr/bin/env bash
FILE_NAME="$1"
PV_WIDTH="$2"
PV_WIDTH="$((PV_WIDTH - 2))"
PV_HEIGHT="$3"
echo "${PV_WIDTH}x${PV_HEIGHT}" > ~/.dim
chafa --size="${PV_WIDTH}x${PV_HEIGHT}" --view-size="${PV_WIDTH}x${PV_HEIGHT}" "$FILE_NAME"