Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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