Making literary hours based on e-books

Original author: tjaap
  • Transfer

My girlfriend reads books avidly. She teaches and studies English literature, so she reads an average of 80 books a year.

In the list of her desired purchases were listed hours for the living room. I could buy a wall clock in the store, but is it interesting? Instead, I made her a watch telling time with quotes from various literary sources and using an e-book as a display - this is so appropriate.

Hours are updated every minute; For example, at 9:23 on Kindle it will be written:
I met him at the station, at 9.23pm Birmingham express.

[ citation from Sue Townsend's The Secret Diary & Growing Pains of Adrian Mole Aged 13¾ / approx. trans. ]

At the same time, I arranged everything so that the Kindle can continue to be used as a normal reader. Just if you turn on the clock, it will work as a literary quiz. The clock shows a quote without the title of the work and the name of the author, so one can only guess about them. And if you need to know the exact answer, then clicking on the browse buttons will show this information.

Step 1: Tools and Materials

In fact, all that is needed is the e-book itself (and the USB cable to it). Kindle for this project was donated to me by my friend. This is a Kindle 3 WiFi (K3 or K3W for short). On eBay you can find a lot of similar devices that were in use.

You will need a computer with any OS, with an SSH client, for example, vSSH, and a client for sFTP, for example Filezilla. Since Kindle runs on Linux, experience with this OS does not hurt.

To set the Kindle upright on the cabinet, I made a stand for it from concrete. If you want to repeat my experience, you will need a suitable food container, food film, foam, cement, thermoplastic adhesive or double-sided adhesive tape, and a bucket for mixing cement.

Step 2: Kindle Jailbreak

To turn a Kindle into a watch, you need to climb into its system files. To do this, it must be opened through a process known as “jailbreak” [jailbreak] (the process is legal if you own a Kindle). Description and files for the process can be found on this site . Also appreciate the list of available software . And on this page, you can find out what your Kindle model is.

For this project, you only need to install two hacks - jailbreak and usbnet , without a screen saver. USBNetwork will give you a remote console access to the Kindle, either via USB or via WiFi. If you want to use the keyboard keys, you need the Launchpad hack .

Warning: further action may in principle spoil your Kindle. Follow the instructions. Everything you do, you do at your own peril and risk.

When you connect your Kindle to your computer, it’s visible to you as a USB flash drive.

All you need to do is to place the Update_jailbreak_0.13.N _ *** _ install.bin file (where *** is your Kindle version instead of *** - I have k3w) in the Kindle root directory.

As it is written in the README file, you need to safely remove the Kindle, go to the main menu of the reader, then to the settings, and select the update there. Everything must go fast.

The same must be done with USBNet and Launchpad files. After that, you should be able to access the device via SSH. To do this, you need to connect your Kindle to WiFi. You can find the IP address by going to the settings of a WiFi router. The username will be root, and the password is calculated by the model in the online calculator .

Then you need to install on Kindle Python, again using files from the excellent forum.

Step 3: make images for every minute of the day

At the bottom of 1440 minutes. Compiling a list of quotes for each minute, using several literary sources - the company is serious. Fortunately, others have already done this for us.

In 2011, the Guardian newspaper asked readers to send them quotes from books mentioning time. They had to make an installation for the festival of literature. As a result, they posted two versions of the list.

Unfortunately, the list did not cover absolutely every minute of the day. I bypassed it, using some quotes several times - for example, if the quote can be used both before and after midnight. Inaccurate references to time can also be used - for example, for the time of two to six I used the following excerpt from the book “The Catcher in the Rye”: “I didn’t sleep too long because I woke up, I think, somewhere around ten o'clock” .

But even with such a good list, it took me too much time for two tasks. Each quote I had to turn into an image. I wanted them to fit beautifully into the screen, so for each quotation it was necessary to choose the maximum possible font.

In most image editing programs, it is quite easy to scale a rectangle with text manually to the desired size. But it would take too much work to create all the images manually. However, the creation of the script took me a decent amount of time. I used PHP for this, since it has convenient functions for working with text), and wrote a recursive function that looks for the best scale option for each quote. For each line, the script produces two PNG images — with and without metadata.

I used the font Libertine - it seems to me stylish, it has all the necessary characters, including accents, and because it is distributed freely.

The second thing that took me a lot of time was recognizing the time mentioned in the quotations, because I wanted to write them in bold. It's easier to use a watch, especially when the quote is long. The problem is that the books use a huge variety of time descriptions. '6.00 pm', '18: 11: 00 ',' 0600h ',' around six o'clock ',' at six ',' twenty-eight minutes past eleven ', and so on. I wrote a script that tries to recognize almost all the options, manually recognized those with which he could not cope, and added them to the CSV.

If you want to make such a watch yourself, you can use my scripts, or simply download the already finished images.

CSV , scripts , images

Step 4: Start and stop the clock

I wanted so that I could launch literary hours by pressing Shift + C on the reader’s keyboard. Pressing it again stops the clock and turns the device back into an e-book.

First you need to create the folder / mnt / us / timelit, and place the scripts there.

Images go to / mnt / us / timelit / images and / mnt / us / timelit / images / metadata /

After installing the Launchpad, the folder / mnt / us / launchpad appears. Create a new startClock.ini file in it and place the following text there: This will create a keyboard shortcut for Shift + C. Keystroke runs a script for bash, He stops the Kindle platform (normal interface), forbids the book to go into power saving mode, and creates a small file (/ mnt / us / timelit / clockisticking) indicating that the clock is running.

C = !sh /mnt/us/timelit/ &

When you press Shift + C again and there is a clockisticking file in the system, the script deletes it and restarts the Kindle system. also runs another script,, which includes keystrokes that show metadata (with the / usr / bin / waitforkey command). If the user presses the page key on the side of the Kindle, the script checks if the clock is running, and if it works, shows the same image as shown now (and the image name is stored in the clockisticking file), but with the book title and author name assigned.

Changing the image every minute is done by adding a line to the / etc / crontab / root file:

* * * * * sh /mnt/us/timelit/

After that, you need to restart the crontab: /etc/init.d/cron restart

Each time you run, checks for the presence of a clockisticking file. If available, it displays a picture for the current minute.

You will probably need to change the time zone in the file, where 'TZ = CEST' is. file

Step 5: make a stand

I got the idea to make a cement base in another article with Instructables. It was possible to make it from wood (or even from a book ), but I wanted to try the cement, since I had not worked with it yet, and since I decided that the gray color would go well with the book.

I cut out a piece of foam the size of a book, and added space for a USB cable. I wrapped it in film and tape so that the cement could later be easily removed. I glued it to the bottom of the food container with double-sided tape.

Then I mixed the cement enough to fill the container by 5 cm. Perhaps I took less water than I needed, since the cement turned out to be thicker than I had planned. It will be necessary to pass the course of work with cement next time .

I threw the cement into the container with a garden spatula, prymyal it a little, and left to dry for two days.

Next time I will try to make a cement product with a smoother surface. To do this, it will be necessary to weed out small stones, add more water, and more time to spend on polishing the product. I will also make a recess for the USB cable so that it can be pulled back — this can be done with a straw.

Step 6: Further Ideas

Literary hours look cute, and the quiz works. My girlfriend periodically checks which book to quote from (usually she guesses correctly). The stand turned out not quite the way I wanted, but I already want to try to make another, better.

Probably, I will add a lamp - either I will attach it to the device, or I will build it into the stand. Sometimes on the clock, standing on the closet, the text is not very clearly visible.

Instead of a separate power supply for the lamp, you can plug it into one of the slots for the Kindle hinges. Two slots are needed for covers with built-in backlight. To do this, you have to open the Kindle and do soldering, or make your own metal clips - but the result should be beautiful. You can even connect a light sensorso that the lamp lights up only when it is dark.

What else would I like to add:
  • Stop the clock from 1 to 6 in the morning to save energy.
  • Turn off WiFi, but turn it on daily for a couple of minutes to synchronize the clock.
  • Show percentages of the past minute in the form of small rectangles at the bottom - as Kindle shows the percentage of reading the book.
  • Show a warning when the battery is low.

The last two points can be done by overlaying small images on top of large ones with the help of the Kindle eips team - look at my scripts.

Other possible ideas:
  • Use Kindle buttons to set the time.
  • Show the default image when the clock starts, or when the picture is not found.
  • Use keyboard shortcut (say, shift-Q) to switch the quiz mode.
  • Run the sound of Big Ben at the beginning of the hour (only during the day), because I have a speaker in my Kindle. You can also add the sound of closing a book or even reading a quote out loud.

Also popular now: