Code Monkey home page Code Monkey logo

kobo-nightmode's Introduction

kobo-nightmode

A tiny hack to read white-on-black on Kobo ebook readers. Works only on the eInk series:

Since the update to firmware 2.6+ Kobo has moved to hardware float proccessing, requiring a new toolchain and partly breaking binary compatibility with older software. Currently this hack still works on firmwares below 2.6, but it is highly recommended to upgrade. If you need help or find a bug, check the mobileread thread, or create an issue on github.

Usage

There are two ways to contol nightmode:

  • Long-press the LIGHT / HOME button on your device to toggle
  • Write into the /tmp/invertScreen fifo-interface
    • Send y to set nightmode to ON
    • Send n to set nightmode to OFF
    • Send t to toggle

A sample script to toggle is provided in extra/nightmode.sh. As the Kobo Mini has no physical buttons, the fifo-interface is currently the only way to control nightmode when running and thus, relies on external tools such as:

Configuration

The configuration file called nightmode.ini is located in your .kobo folder:

# config file for kobo-nightmode

[state]
invertActiveOnStartup = no      # yes / no
retainStateOverRestart = yes    # yes / no

[control]
longPressDurationMS = 800       # time in milliseconds to toggle

[nightmode]
refreshScreenPages = 4  		#force refresh every X pages

invertActiveOnStartup determines whether nightmode is active after booting. retainStateOverRestart determines whether the state should be kept over a restart. refreshScreenPages sets the number of pages between screen refreshs when nightmode is active. If you want to disable this feature, set it to 0.

Installation

In the installer/uninstaller directories, two KoboRoot.tgz files are provided for automatic installation and removal. Simply copy one of them into the .kobo folder on your device, safely remove, and wait for the reboot to finish.

How it works

This hack works by intercepting and modifying screen-update requests on-the-fly from the main reader application. This is accomplished by interposing the ioctl() function using LD_PRELOAD. Therefore /etc/init.d/rcS has to be modified to start nickel, the main app with the screenInv.so dynamic library. For the Kobo Aura, the inverting has to be done in software due to a kernel bug. By interposing mmap(), memory accesses to framebuffer can be redirected into a virtual buffer, from which the inverted data is pushed to the screen.

FAQ

  • I have updated my firmware and it stopped working!
    • Simply install the mod again, if it still doesn't work post in the thread.
  • Will this drain my battery?
    • The effect on battery life should be negligible
  • I can see more ghosting when the mod is activated!
    • This is normal, as eInk screens are optimized for black-on-white mode. Change the refresh rate if it annoys you.

Compile for yourself

All you need can be found in Kobo's Kobo-Reader repository:

  • An linux tarball for the imx507 platform
  • The gcc-linaro-arm-linux-gnueabihf toolchain to compile

Credits

kobo-nightmode's People

Contributors

dbeinder avatar kenmacd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kobo-nightmode's Issues

Doesn't work on Kobo Nia (firmware 4.30.18838)

Hello, i've recently installed this mod but it doesn't work. I have tried everything : i have NickelMenu with KoboLauncher and they never appeared in the first place. So i edited some files to show them (in the .adds/nm folder i added a nightmode.ini file wich launch the nightmode.sh, and i added "Nightmode = nightmode.sh" into the applications.ini of KoboLauncher) but it still doesn't work.
I also tried this :

[brightness]
1percentPatch = yes
timeout = 4
100 = toggleNightMode

but it doesn't work again. I have tested everything, please help me !

Nightmode no longer working on firmware 4.3.8842 (Kobo Aura H20)

First off, thank you for this project, nightmode is awesome! Yesterday, without thinking about it I updated the firmware on my Kobo Aura H20, it's now at 4.3.8842. Sadly, this also broke the nightmode patch I was using that's linked in issue #6

I would really like it back, any tips on how to fix?

Doesn't work on Kobo Aura

This worked for me last year, but I recently had to factory reset my eReader. Then it updated to software version 4.5.9587. I installed the nightmode as instructed, but it doesn't change to nightmode after long-pressing the light button.

Glo loosing USB-connection

Hello,

today I'd updated my Kobo Glo to 3.1.1 (761b066420, 11.12.13) and installed the nightmode for the first time afterwards.

Nightmode worked fine, but my glo was loosing the USB-connection after approximately 10 seconds and was rebooting automatically. Same behaviour on two PCs (both with Windows XP)

I managed to load the uninstallation-file to my Kobo in the short period the USB-connection was established. Kobo installed and rebooted. Afterwards the USB-connection was working flawlessly.

My Glo is one of the earlyer models with the blueish light.

With kind regards

kobo-ld

GloHD support?

I'd like to use nightmode on my GloHD, but there's no light button :(. Are there any plans to add support for GloHD?

Works with Kobo version 3.8 + advice for Mac users

Updated to 3.8 and it still works (after re-installation). Mac users should be advised that the .kobo folder will be invisible until they apply one of the many tricks to get the Mac Finder to show invisible files (files with names that start with a . ) Get the invisible files showing, update then turn off the display of invisible files. Instructions should be edited to make this step clear for Mac users.

Aura H20 Support?

I see it supports the Aura and the Aura HD.

Long pressing the home or light button doesn't change the Aura H20 into nightmode.

Will there be support for this Kobo?

New Firmware for Kobo Touch Broke Night Mode Build 13

Firmware 4.3.8842 for Kobo Touch was released on 2/21/2017. After installing the new firmware the night mode long press function no longer worked. I tried uninstalling and reinstalling build 13 and it didn't work. It would be nice to get it working again.

Thanks,

Blake

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.