From ae89cde7d22806077e0e3d38f212c6b215a0c4e9 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Sat, 2 Mar 2019 07:30:14 -0600 Subject: [PATCH] Editing vifm configs to use ueberzug for video previews as well as image previews. --- .config/vifm/scripts/vifmimg | 8 +++++++- .config/vifm/vifmrc | 9 ++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.config/vifm/scripts/vifmimg b/.config/vifm/scripts/vifmimg index de4379e..b36d697 100755 --- a/.config/vifm/scripts/vifmimg +++ b/.config/vifm/scripts/vifmimg @@ -7,7 +7,13 @@ if [ -e "$FIFO_UEBERZUG" ]; then [x]="$2" [y]="$3" [width]="$4" [height]="$5" \ [path]="${PWD}/$6") \ > "$FIFO_UEBERZUG" - else + elif [[ "$1" == "videopreview" ]]; then + [[ ! -f "/tmp/$6.png" ]] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp/$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/$6.png") \ + > "$FIFO_UEBERZUG" + elif [[ "$1" == "clear" ]]; then declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \ > "$FIFO_UEBERZUG" fi diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 349f74a..275389c 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -217,7 +217,10 @@ filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, \*.as[fx] - \ ffprobe -pretty %c 2>&1 + \ vifmimg videopreview %px %py %pw %ph %c + \ %pc + \ vifmimg clear + " \ ffprobe -pretty %c 2>&1 " Web filextype *.html,*.htm @@ -246,10 +249,6 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm \ feh %d &, \ {View in cacaview} \ cacaview %c &, - \ {View in gpicview} - \ gpicview %c, - \ {View in shotwell} - \ shotwell, fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm \ vifmimg draw %px %py %pw %ph %c \ %pc