From 2bd5241c62ed35b66356074f350267bc48865b15 Mon Sep 17 00:00:00 2001 From: Findus23 Date: Mon, 2 Nov 2015 10:51:21 +0100 Subject: [PATCH] Add script for generating thumbnails for all viedeos --- recursive.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 recursive.sh diff --git a/recursive.sh b/recursive.sh new file mode 100755 index 0000000..a314dd7 --- /dev/null +++ b/recursive.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +exec 3> >(zenity --progress --title="generating thumbnails..." --percentage=0 --width=400 --no-cancel ) +echo "# searching for files..." >&3 +files=$(find . -name '*.webm') +echo "$(tput setaf 2)The following files werde found:$(tput sgr0)" +echo "$files" +echo "----" +num_files=$(echo "$files"| wc -l) +a=1 +find . -name '*.webm' -print0 | while read -d $'\0' file # http://stackoverflow.com/a/15931055 +do + echo "$(tput setaf 2)$file$(tput sgr0)" + echo "# $file ($a/$num_files)" >&3; + ./thumbnail.sh "$file" best + echo "$a/$num_files*100" | bc -l >&3 #percentage + ((a++)) +done + +echo "# finished generating thumbnails" >&3 +notify-send "Thumbnails" "finished" #im Paket libnotify-bin