commit b7927855870f0366944a469fb7d720504fa490af Author: user Date: Thu Feb 13 13:24:40 2020 +1000 initial diff --git a/Make telegram sticker b/Make telegram sticker new file mode 100755 index 0000000..ae27657 --- /dev/null +++ b/Make telegram sticker @@ -0,0 +1,24 @@ +#!/bin/bash + +## Dependencies +# ImageMagick (convert and identify) +# bc + +count=0; +(for name in "$@"; do + geometry=$(identify -verbose "$name" | grep geometry | cut -d' ' -f5 | cut -d'+' -f1) + width=`echo $geometry | cut -d'x' -f1` + height=`echo $geometry | cut -d'x' -f2` + + if [ $width -gt $height ]; then + resize="512" + else + resize="x512" + fi + + convert "$name" -resize $resize "$name.png" + count=$(echo "($count + 1)" | bc) + percent=$(echo " scale=2; ( 100 * ($count/$#))" | bc ) + echo "$percent" + done; +) | zenity --progress --percentage=0 --auto-close --text="Making Stickers" diff --git a/convert to mp3 b/convert to mp3 new file mode 100755 index 0000000..4ea8fd5 --- /dev/null +++ b/convert to mp3 @@ -0,0 +1,10 @@ +#!/bin/bash + +count=0; +( for file in "$@"; do + ffmpeg -nostdin -y -i "$file" "$file.mp3" + count=$(echo "($count + 1)" | bc) + + percent=$(echo " scale=2; ( 100 * ($count/$#))" | bc ) + echo "$percent" +done ) | zenity --progress --percentage=0 --auto-close --text="Converting files" diff --git a/convert to mp4 b/convert to mp4 new file mode 100755 index 0000000..881504d --- /dev/null +++ b/convert to mp4 @@ -0,0 +1,10 @@ +#!/bin/bash + +count=0; +( for file in "$@"; do + ffmpeg -nostdin -y -i "$file" "$file.mp4" + count=$(echo "($count + 1)" | bc) + + percent=$(echo " scale=2; ( 100 * ($count/$#))" | bc ) + echo "$percent" +done ) | zenity --progress --percentage=0 --auto-close --text="Converting files"