A set of POSIX* shell scripts designed for personal use. No guarantees when it comes to quality, as these are also used for various minor experiments of mine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
444 B

#!/bin/sh -e
type=$(file --mime-type "${1}" | cut -f 2 -d ' ')
case "${type}" in
*image/png*)
x=$(/bin/file "${1}" | /bin/grep -o "[0-9]* x [0-9]*" | sed 's/ x /x/')
;;
*image/jpeg*)
x=$(/bin/file "${1}" | /bin/grep -o "[0-9]*x[0-9]*" | sed "2!d")
;;
*)
x=$(/bin/file "${1}" | /bin/grep -o "[0-9]* x [0-9]*" | sed 's/ x /x/')
;;
esac
11 months ago
if [ -x /bin/sxiv ]
then
/bin/sxiv -bg "${x}" "${1}"
else
11 months ago
/bin/meh "${1}"
11 months ago
fi
exit