Hazel and Kindle Comic Converter Automation for Kindle Reading

ExcitingI like to read comics on the go, and there is no easier way to tote them than on a Kindle. The preferred tool of people who like to convert comics for kindle reading is Kindle Comic Converter. It has a nice GUI interface and after conversion from .cbr or .cbz to .mobi format, you can e-mail it to your kindle. This works great for most readers, but I prefer a more automated method for getting comics comverted and onto my kindle. As soon as a comic (.cbr or .cbz) file is downloaded or placed in a specified directory, with no more action on my part, it is automatically converted to .mobi format and e-mailed to my kindle.

This guide is for Mac users that have Hazel installed. If you own a Mac and aren’t using Hazel, you are denying yourself the true power of Mac automation. I highly recommend it. Assuming you have a Mac and you have Hazel installed, let’s begin.

THE STUFF WE HAVE TO DO BEFORE THE FUN HAPPENS:

Install homebrew, python 3, and KCC dependencies:

Depending on what version of macOS you are using and what you may or may not have installed previously, your mileage may vary on this first part. It may require some tweaking, googling, etc. I have tried to include as much info as possible to at least give you a frame of reference for what needs to be done before we can use the command line Kindle Comic Converter.

Open Terminal
mkdir KCC-Process
cd KCC-Process

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

brew update
brew install python3
brew linkapps python3
pip3 install –upgrade pip setuptools
brew install psutils *OR* pip install psutil
brew install slugify *OR* sudo pip install python-slugify
brew install homebrew/python/pillow *OR* pip install Pillow
brew install unrar
cd other/osx
sudo cp unrar /usr/local/bin (so KCC can find it)
brew install homebrew/binary/kindlegen

NOW THE FUN STUFF:
The conversion will take place in the using the Kindle Comic Coverter command line tool, so download the KCC package from GitHub (https://github.com/ciromattia/kcc/). Unzip the package into KCC-Process directory.

Set your hazel rule for the KCC-Process directory.

Hazelrule

Your shell script will look like this. I am using the KV (Kindle Voyage) profile.

FULL_PATH=”$1″
ORIG_FILE=$(basename “$FULL_PATH”)
python3 kcc-c2e.py –profile KV “$ORIG_FILE”

Now any cbz or cbr file dropped into the KCC-Process directory will be converted to .mobi format ready for your Kindle. If you want to automate the next step of e-mailing the .mobi file to your Kindle, you need to create an Automator script like this.

Automatoremail

Then add the script execution to a Hazel rule. You can have the rule activate in the KCC-Process directory or you can do as I do, and move the newly created .mobi from KCC-Process to a directory called Kindle-eMail where this Hazel rule will e-mail the .mobi to your Kindle of choice.

Hazelmail

If you want more ideas or guidance on using Hazel, I recommend David Sparks’ Hazel Field Guide.

Install Python 3 & Pygame on Mac OS X Yosemite

This tutorial has been updated from Mavericks to Yosemite. I have tested it and it works perfectly.

Install the Xcode Command Line Tools from Apple. Apple now provides an official Command Line Tools for Xcode package that you can install without needing to install Xcode itself. You can install it with xcode-select –install on Mavericks and Yosemite or download it from Apple’s developer site (free registration required) and search for “Command Line Tools”

Install Quartz from here

Install Homebrew and necessary tools:

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

brew update

brew install python3 (this currently installs version 3.4.3_2)

brew install mercurial

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
brew tap homebrew/headonly
brew install smpeg

Clone the pygame repository:

cd /Users/YourName/Downloads
hg clone https://bitbucket.org/pygame/pygame
cd pygame
cd src

Copy this file into src, replacing the one there.

Install Pygame:

/usr/local/Cellar/python3/3.4.3_2/bin/pip3.4 install /Users/YourName/Downloads/pygame

That’s it. You can test your install by opening idle3 app located in:
/usr/local/Cellar/python3/3.4.3_2
then type: import pygame [hit return]
if there is no error, you were successful.

If this tutorial helped you, please follow me on twitter @dudeslife .

Hidden Classic Games in your Mac.

Play Tetris, Pong, and Other Retro Games

The text editor emacs has a collection of games hidden inside, including Snake, Tetris, Pong, Solitaire, Towers of Hanoi, and more. To access these little easteregg jems, here’s what you’ll need to do:

  • Type ‘emacs’ at the command line, then hit Function+F10, then ‘t’, then ‘g’
  • Select the game from the list by using arrow keys or by hitting a key corresponding to the game, S for Solitaire, T for Tetris, t for Hanoi, s for Snake, etc

The controls take some getting used to, but the games are playable enough to pass the time. [ via OS X Daily ]

Tetris in the Terminal