#!/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"