Added ueberzugpp to lf
This commit is contained in:
parent
613c97cee8
commit
fc2e67675d
4 changed files with 50 additions and 40 deletions
|
|
@ -1,28 +1,27 @@
|
|||
#!/bin/sh
|
||||
CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' \
|
||||
-- "$(readlink -f "$1")" | sha256sum | awk '{print $1}'))"
|
||||
|
||||
image() {
|
||||
# if [ -n "$DISPLAY" ]; then
|
||||
# printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y":"%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' \
|
||||
# "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG"
|
||||
# exit 1
|
||||
# else
|
||||
chafa "$1" -s "$4x"
|
||||
# fi
|
||||
FILE_PATH="$1"
|
||||
X=$4
|
||||
Y=$5
|
||||
MW=$(($2 - 1))
|
||||
MH=$3
|
||||
ueberzugpp cmd -s "$UB_SOCKET" -a add -i PREVIEW -x "$X" -y "$Y" --max-width "$MW" --max-height "$MH" -f "$FILE_PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
batorcat() {
|
||||
file="$1"
|
||||
shift
|
||||
if command -v bat > /dev/null 2>&1
|
||||
then
|
||||
bat --color=always --style=plain --pager=never "$file" "$@"
|
||||
else
|
||||
cat "$file"
|
||||
fi
|
||||
file="$1"
|
||||
shift
|
||||
if command -v bat >/dev/null 2>&1; then
|
||||
bat --color=always --style=plain --pager=never "$file" "$@"
|
||||
else
|
||||
cat "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}'))"
|
||||
|
||||
case "$(file --dereference --brief --mime-type -- "$1")" in
|
||||
image/*)
|
||||
image "$1" "$2" "$3" "$4" "$5" "$1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue