diff --git a/.bin/autoWallpaper.sh b/.bin/autoWallpaper.sh index b2e80e3..546ee71 100644 --- a/.bin/autoWallpaper.sh +++ b/.bin/autoWallpaper.sh @@ -3,6 +3,7 @@ export DISPLAY=:0 feh --randomize --bg-fill /home/edupin/.config/awesome/background/* >> /home/edupin/aaaaaaaa_last_update_wallpaper.txt +#feh --randomize --bg-fill /home/heero/.config/awesome/background/* # crontab -e # ou edn /var/spool/cron/edupin diff --git a/.bin/book_1_remove_black_border.sh b/.bin/book_1_remove_black_border.sh new file mode 100755 index 0000000..70b7f8f --- /dev/null +++ b/.bin/book_1_remove_black_border.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# user input +MAXLEN=1200 +DESTINATION_DIR="WorkInProgress" + +nb_elem=0 +for i in *.JPG; do + nb_elem=`expr $nb_elem + 1` +done +echo "number of element: $nb_elem" + +idelem=0 +idcover=0 +zero=0 + +[ -d $DESTINATION_DIR ] || mkdir $DESTINATION_DIR +for iii in *.JPG; do + echo "element $iii" + if [ -e $iii ] ; then + if [ $idcover -eq $zero ] ; then + idcover=1 + echo "#egami-cutter file (" $idelem "/" $nb_elem "): " $iii " ==> " $DESTINATION_DIR/cover.png + egami-cutter -i=$iii -o=$DESTINATION_DIR/cover.png + else + idelem=`expr $idelem + 1` + echo "#egami-cutter file (" $idelem "/" $nb_elem "): " $iii " ==> " $DESTINATION_DIR/page_$idelem.png + egami-cutter -i=$iii -o=$DESTINATION_DIR/page_$idelem.png + fi + fi +done + + diff --git a/.bin/book_2_rotate_right.sh b/.bin/book_2_rotate_right.sh new file mode 100755 index 0000000..6167286 --- /dev/null +++ b/.bin/book_2_rotate_right.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# user input +MAXLEN=1200 +SOURCE_DIR="WorkInProgress" +DESTINATION_DIR="WorkInProgress_2" + +nb_elem=0 +for i in $SOURCE_DIR/*.png; do + nb_elem=`expr $nb_elem + 1` +done + +idelem=0 + +if [ -d $SOURCE_DIR ] ; then + echo "WIP exist ==> continue" +else + echo "WIP does not exist ==> break" + exit -1 +fi + +[ -d $DESTINATION_DIR ] || mkdir $DESTINATION_DIR + +cd $SOURCE_DIR +for iii in *.png; do + if [ -e $iii ] ; then + idelem=`expr $idelem + 1` + echo "#rotate file (" $idelem "/" $nb_elem "): " $SOURCE_DIR/$iii " ==> " $DESTINATION_DIR/$iii + convert $iii -rotate 90 ../$DESTINATION_DIR/$iii + fi +done + +cd .. + diff --git a/.bin/book_3_reduce_size.sh b/.bin/book_3_reduce_size.sh new file mode 100755 index 0000000..f711c2d --- /dev/null +++ b/.bin/book_3_reduce_size.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# user input +MAXLEN=1700 +SOURCE_DIR="WorkInProgress_2" +DESTINATION_DIR="WorkInProgress_3" + +nb_elem=0 +for i in $SOURCE_DIR/*png; do + nb_elem=`expr $nb_elem + 1` +done + +idelem=0 + +if [ -d $SOURCE_DIR ] ; then + echo "WIP exist ==> continue" +else + echo "WIP does not exist ==> break" + exit -1 +fi + +[ -d $DESTINATION_DIR ] || mkdir $DESTINATION_DIR + +cd $SOURCE_DIR +for iii in *.png; do + if [ -e $iii ] ; then + idelem=`expr $idelem + 1` + echo "#resize file (" $idelem "/" $nb_elem "): " $SOURCE_DIR/$iii " ==> " $DESTINATION_DIR/${iii::-4}.jpg + convert $iii -resize ${MAXLEN}x${MAXLEN} ../$DESTINATION_DIR/${iii::-4}.jpg + fi +done + +cd .. + diff --git a/.bin/book_4_correct_brigthness.sh b/.bin/book_4_correct_brigthness.sh new file mode 100755 index 0000000..ee765eb --- /dev/null +++ b/.bin/book_4_correct_brigthness.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# user input +MAXLEN=1700 +SOURCE_DIR="WorkInProgress_3" +DESTINATION_DIR="WorkInProgress_4" + +nb_elem=0 +for i in $SOURCE_DIR/*jpg; do + nb_elem=`expr $nb_elem + 1` +done + +idelem=0 + +if [ -d $SOURCE_DIR ] ; then + echo "WIP exist ==> continue" +else + echo "WIP does not exist ==> break" + exit -1 +fi + +[ -d $DESTINATION_DIR ] || mkdir $DESTINATION_DIR + +cd $SOURCE_DIR +for iii in *.jpg; do + if [ -e $iii ] ; then + idelem=`expr $idelem + 1` + echo "#brightness file (" $idelem "/" $nb_elem "): " $SOURCE_DIR/$iii " ==> " $DESTINATION_DIR/$iii + convert $iii -brightness-contrast 30x45 ../$DESTINATION_DIR/$iii + fi +done + +cd .. + diff --git a/.bin/downloadEpub.sh b/.bin/downloadEpub.sh new file mode 100755 index 0000000..7496c04 --- /dev/null +++ b/.bin/downloadEpub.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "Download all epub of www.feedbooks.com/book/xxx.epub" +#for iii in {0..5000} +#do +# echo "* File : "$iii +# #wget --content-disposition -t 1 --timeout=5 www.feedbooks.com/book/$iii.epub +#done + +for iii in {2961..0} +do + echo "* File : "$iii + wget --content-disposition -t 1 --timeout=5 www.ebooksgratuits.com/newsendbook.php?id=$iii\&format=epub +done + diff --git a/.bin/renameGroup.py b/.bin/renameGroup.py new file mode 100755 index 0000000..75491c2 --- /dev/null +++ b/.bin/renameGroup.py @@ -0,0 +1,64 @@ +#!/usr/bin/python3 +import os +import fnmatch +import glob + +print("Start rename group ...") + +def extract_id(value): + id = "" + for elem in value: + if elem == '0' \ + or elem == '1' \ + or elem == '2' \ + or elem == '3' \ + or elem == '4' \ + or elem == '5' \ + or elem == '6' \ + or elem == '7' \ + or elem == '8' \ + or elem == '9': + id += elem + else: + break + return int(id) +base_name = "Trollhunters.S01E" +out_name = "Troll hunters-s01-e" +files = glob.glob(base_name + "*") +max = 0 +for file in files: + id = extract_id(file[len(base_name):]) + if id > max: + max = id + +print("number of Element: " + str(max)) + +nb_char = 1 +if max>99999: + nb_char = 6 +elif max>9999: + nb_char = 5 +elif max>999: + nb_char = 4 +elif max>99: + nb_char = 3 +elif max>9: + nb_char = 2 + +def get_id(id): + val = str(id) + while len(val) " + outfile) + os.rename(file, outfile) + +exit(0)