lel

farbfeld image viewer
git clone git://git.2f30.org/lel
Log | Files | Refs | README | LICENSE

lel-open (588B)


      1 #!/bin/sh
      2 filename="$1"
      3 shift
      4 ext=$(basename "$filename" | grep -o '\..[^\.]*$')
      5 convert=""
      6 
      7 if test x"$ext" = x".jpg"; then
      8 	convert="jpg2ff"
      9 elif test x"$ext" = x".png"; then
     10 	convert="png2ff"
     11 elif test x"$ext" = x".gif"; then
     12 	convert="gif2ff"
     13 elif test x"$ext" = x".ff"; then
     14 	convert="cat"
     15 elif test x"$ext" = x".bz2"; then
     16 	convert="bzip2 -dc"
     17 elif test x"$ext" = x".gz"; then
     18 	convert="gzip -dc"
     19 elif test x"$ext" = x".xz"; then
     20 	convert="xz -dc"
     21 else
     22 	echo "unknown extension \"$ext\"" >&2
     23 fi
     24 
     25 if test x"$convert" != x""; then
     26 	$convert < "$filename" | lel -t "$filename" "$@"
     27 fi