Last active
August 19, 2023 08:11
-
-
Save uriel1998/402bebb02d071039032d77f286b2c40d to your computer and use it in GitHub Desktop.
fehview.sh -- uses feh, gifview, and heif-convert to get quick previews
This file contains 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 | |
# uses gifview: https://linux.die.net/man/1/gifview | |
# uses heif-convert: https://pypi.org/project/heif-convert/ | |
shopt -s nullglob | |
if [[ ! -f $1 ]]; then | |
notify-send "ERROR" | |
echo "$0: first argument is not a file" >&2 | |
exit 1 | |
fi | |
if [[ "$1" =~ .*.heic ]];then | |
tmpfile=$(echo "$(mktemp).jpg") | |
heif-convert -q 75 "${1}" "${tmpfile}" | |
bob=$(feh --auto-zoom --scale-down --geometry 640x480 "${tmpfile}") | |
rm "${tmpfile}" | |
else | |
if [[ "$1" =~ .*.gif ]];then | |
gifview -a "$1" | |
else | |
bob=$(feh --auto-zoom --scale-down --geometry 640x480 "$1") | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment