Skip to content

Instantly share code, notes, and snippets.

@jugR0jones
Created January 1, 2018 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jugR0jones/2c160404aff952c9a2a8802382ec978e to your computer and use it in GitHub Desktop.
Save jugR0jones/2c160404aff952c9a2a8802382ec978e to your computer and use it in GitHub Desktop.
#!/bin/bash
# Original Author: Alon Ivtsan
# License: GPL3+
# Modified by: Jones.
# Convers a folder of .cbz Comic book files to .CBR files on a linux system running the KDE Environment.
# This script requires the unrar and notify-send binaries to be available.
for FILE in *{.cbr,.CBR}
do
[ -e "$FILE" ] || continue
#echo Converting $FILE to cbz format.
DIR="${FILE%.*}"
mkdir "$DIR";
unar ./"$FILE" -o "$DIR";
zip -r "$DIR".cbz "$DIR";
rm -r "$DIR";
#Remove or comment out this line if you want to keep cbr files
#rm "$FILE";
# echo Conversion of $FILE successful!
done
notify-send --app-name="cbr2cbz" "Conversion Complete" "All .cbr files have been converted to .cbz files" -u normal -i checkbox-checked-symbolic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment