Skip to content

right9code/sleepwaketracker.koplugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sleep/Wake Tracker Plugin for KOReader

Screenshot

A comprehensive plugin that tracks your reading habits by logging device sleep (suspend) and wake (resume) events. It provides detailed statistics, battery tracking, and data management features.

Features

  • Automatic Logging:

    • Records "SLEEP" and "WAKE" timestamps automatically.
    • Battery Tracking: Logs battery percentage at every event to track drain.
  • Detailed Statistics:

    • Daily Summary: Shows total active time (e.g., Total Active: 3h 15m) and total battery used (e.g., Bat Used: 12%).
    • Cycle Analysis: Groups Wake/Sleep events into clean cycles with accurate duration and battery drain per session.
      • Example: ☀ 10:00 AM - ☾ 11:30 AM (1h 30m 00s) [-5%]
  • Data Management:

    • Export to CSV: Back up your entire history to a CSV file.
      • Export Path: Saves to the root of your device storage (e.g., /mnt/onboard on Kobo, /mnt/us on Kindle).
      • Filename: .sleepwaketracker_export.csv (hidden file to keep your library clean).
    • Import from CSV: Restore your history from a backup file.
    • Delete Logs: Options to clear today's log or wipe all history.
  • Navigation:

    • Today's View: Instant access to the current day's activity.
    • History Browser: Hierarchical navigation by Year -> Month -> Day.

Installation

On Kobo, Kindle, PocketBook, etc.

  1. Download the latest release from github releases
  2. Connect your device to your computer via USB.
  3. Navigate to the KOReader plugins directory:
    • Kobo: .add/koreader/plugins/
    • Kindle: koreader/plugins/
  4. Copy the folder named sleepwaketracker.koplugin into this directory in your device.
  5. Eject your device safely and restart KOReader.

Usage

  1. Accessing the Menu:

    • Go to Tools (wrench icon) -> Sleep/Wake Tracker.
  2. Viewing Data:

    • Show Today's Events: View current session stats and list of cycles.
    • Browse History: Navigate past logs. Years and Months are grouped for easy access.
  3. Managing Data:

    • Go to Manage Data submenu.
    • Export to CSV: Saves .sleepwaketracker_export.csv to your device root.
      • Connect via USB to copy this file to your PC.
    • Import from CSV: To restore, place a .sleepwaketracker_export.csv file in your device root and select this option.
    • Clear Logs: Delete data if needed.

CSV Format

The exported CSV uses the following format:

Date,Time,Event,Battery
2026-01-07,14:30:00,WAKE,85
2026-01-07,15:00:00,SLEEP,80

Technical Details

  • Device Support: Automatically detects storage root for Kobo (/mnt/onboard), Kindle (/mnt/us), PocketBook (/mnt/ext1), and Android (/sdcard).
  • Data Storage: Logs are stored in koreader/settings/sleepwaketracker/ as simple daily text files (YYYY-MM-DD.txt).
  • Performance: Minimal impact. Only runs momentarily during suspend/resume events.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages