From b7927855870f0366944a469fb7d720504fa490af Mon Sep 17 00:00:00 2001 From: user Date: Thu, 13 Feb 2020 13:24:40 +1000 Subject: [PATCH] initial --- Make telegram sticker | 24 ++++++++++++++++++++++++ convert to mp3 | 10 ++++++++++ convert to mp4 | 10 ++++++++++ 3 files changed, 44 insertions(+) create mode 100755 Make telegram sticker create mode 100755 convert to mp3 create mode 100755 convert to mp4 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"