X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/12b9ffb37074643cefa47f561d90b3f240176cd6..refs/heads/lazyvim:/ranger/scope.sh diff --git a/ranger/scope.sh b/ranger/scope.sh index ff3465b..e2fe435 100755 --- a/ranger/scope.sh +++ b/ranger/scope.sh @@ -267,13 +267,13 @@ handle_image() { # ;; esac - # openscad_image() { - # TMPPNG="$(mktemp -t XXXXXX.png)" - # openscad --colorscheme="${OPENSCAD_COLORSCHEME}" \ - # --imgsize="${OPENSCAD_IMGSIZE/x/,}" \ - # -o "${TMPPNG}" "${1}" - # mv "${TMPPNG}" "${IMAGE_CACHE_PATH}" - # } + openscad_image() { + TMPPNG="$(mktemp -t XXXXXX.png)" + openscad --colorscheme="${OPENSCAD_COLORSCHEME}" \ + --imgsize="${OPENSCAD_IMGSIZE/x/,}" \ + -o "${TMPPNG}" "${1}" \ + && mv "${TMPPNG}" "${IMAGE_CACHE_PATH}" + } case "${FILE_EXTENSION_LOWER}" in ## 3D models @@ -281,9 +281,9 @@ handle_image() { ## is hardcoded as jpeg. So we make a tempfile.png and just ## move/rename it to jpg. This works because image libraries are ## smart enough to handle it. - # csg|scad) - # openscad_image "${FILE_PATH}" && exit 6 - # ;; + csg|scad) + openscad_image "${FILE_PATH}" && exit 6 + ;; # 3mf|amf|dxf|off|stl) # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6 # ;;