aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/vifm/scripts/vifmimg
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-12-12 15:21:53 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-12-12 15:21:53 +0300
commit9c45f84e3cf5db8349a487f5ef3ca0c5277dc7aa (patch)
tree26cfff2d534137249ea81459667d543094ceb240 /dotfiles/.config/vifm/scripts/vifmimg
parent9fe1fb4369ca36497d4971386670d38c0229ff1f (diff)
downloadswayrice-9c45f84e3cf5db8349a487f5ef3ca0c5277dc7aa.tar.gz
swayrice-9c45f84e3cf5db8349a487f5ef3ca0c5277dc7aa.zip
Clean up configs
Remove unneeded junk.
Diffstat (limited to 'dotfiles/.config/vifm/scripts/vifmimg')
-rwxr-xr-xdotfiles/.config/vifm/scripts/vifmimg53
1 files changed, 0 insertions, 53 deletions
diff --git a/dotfiles/.config/vifm/scripts/vifmimg b/dotfiles/.config/vifm/scripts/vifmimg
deleted file mode 100755
index e5d8763..0000000
--- a/dotfiles/.config/vifm/scripts/vifmimg
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env bash
-readonly ID_PREVIEW="preview"
-
-#AUTO_REMOVE="yes"
-# By enabling this option the script will remove the preview file after it is drawn
-# and by doing so the preview will always be up-to-date with the file.
-# This however, requires more CPU and therefore affects the overall performance.
-
-if [ -e "$FIFO_UEBERZUG" ]; then
- if [[ "$1" == "draw" ]]; then
- declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
- [x]="$2" [y]="$3" [width]="$4" [height]="$5" \
- [path]="${PWD}/$6") \
- > "$FIFO_UEBERZUG"
-
- elif [[ "$1" == "videopreview" ]]; then
- echo -e "Loading preview..\nFile: $6"
- [[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/"
- [[ ! -f "/tmp${PWD}/$6.png" ]] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp${PWD}/$6.png" -s 0 -q 10
- declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
- [x]="$2" [y]="$3" [width]="$4" [height]="$5" \
- [path]="/tmp${PWD}/$6.png") \
- > "$FIFO_UEBERZUG"
-
- elif [[ "$1" == "gifpreview" ]]; then
- echo -e "Loading preview..\nFile: $6"
- [[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/" && convert -coalesce "${PWD}/$6" "/tmp${PWD}/$6/$6.png"
- for frame in $(ls -1 /tmp${PWD}/$6/$6*.png | sort -V); do
- declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
- [x]="$2" [y]="$3" [width]="$4" [height]="$5" \
- [path]="$frame") \
- > "$FIFO_UEBERZUG"
- # Sleep between frames to make the animation smooth.
- sleep .07
- done
-
- elif [[ "$1" == "pdfpreview" ]]; then
- echo -e "Loading preview..\nFile: $6"
- [[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/"
- [[ ! -f "/tmp${PWD}/$6.png" ]] && pdftoppm -png -singlefile "$6" "/tmp${PWD}/$6"
- declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
- [x]="$2" [y]="$3" [width]="$4" [height]="$5" \
- [path]="/tmp${PWD}/$6.png") \
- > "$FIFO_UEBERZUG"
-
- elif [[ "$1" == "clear" ]]; then
- declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \
- > "$FIFO_UEBERZUG"
- [[ ! -z $AUTO_REMOVE ]] && [[ -f "/tmp${PWD}/$6.png" ]] && rm -f "/tmp${PWD}/$6.png"
- [[ ! -z $AUTO_REMOVE ]] && [[ -d "/tmp${PWD}/$6/" ]] && rm -rf "/tmp${PWD}/$6/"
-
- fi
-fi