Code Monkey home page Code Monkey logo

Comments (1)

RaZ0rr-Two avatar RaZ0rr-Two commented on June 18, 2024

The problem is fixed. I had another vifmimg file in my ~/.config/vifm/scripts folder. The updated ones were in my ~/.local/bin folder but the older scripts folder ones were being used instead of the new ones. The old one had this content which will not work now I think


#!/bin/sh

CACHE="$HOME/.cache/vifm/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$PWD/$6")" | sha256sum | awk '{print $1}'))"

pclear() {
    declare -p -A cmd=([action]=remove [identifier]="vifm-preview") \
        > "$FIFO_UEBERZUG"
}

image() {
    declare -p -A cmd=([action]=add [identifier]="vifm-preview" \
        [x]="$2" [y]="$3" [width]="$4" [height]="$5" \
        [path]="$6") \
        > "$FIFO_UEBERZUG"
}

main() {
    case "$1" in
        "clear")
			pclear "$@"
			;;
        "draw")
			FILE="$PWD/$6"
			image "$1" "$2" "$3" "$4" "$5" "$FILE"
			;;
        "video")
			[ ! -f "$CACHE" ] && \
				ffmpegthumbnailer -i "$6" -o "${CACHE}.jpg" -s 0 -q 5
			image "$1" "$2" "$3" "$4" "$5" "${CACHE}.jpg"
			;;
        "epub")
			[ ! -f "$CACHE" ] && \
				epub-thumbnailer "$6" "$CACHE" 1024
			image "$1" "$2" "$3" "$4" "$5" "$CACHE"
			;;
        "pdf")
			[ ! -f "${CACHE}.jpg" ] && \
				pdftoppm -jpeg -f 1 -singlefile "$6" "$CACHE"
			image "$1" "$2" "$3" "$4" "$5" "${CACHE}.jpg"
			;;
        "audio")
			[ ! -f "${CACHE}.jpg" ] && \
				ffmpeg -i "$6" "${CACHE}.jpg" -y &> /dev/null
			image "$1" "$2" "$3" "$4" "$5" "${CACHE}.jpg"
			;;
        "font")
			[ ! -f "${CACHE}.jpg" ] && \
				fontpreview -i "$6" -o "${CACHE}.jpg"
			image "$1" "$2" "$3" "$4" "$5" "${CACHE}.jpg"
			;;
        *)
			echo "Unknown command: " "$@"
			;;
    esac
}
main "$@"


from vifmimg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.