A monorepo containing a 24-hour analog clock implemented as both an Android Live Wallpaper and a Python Desktop Widget. Both versions feature deep Fitbit integration and a research-backed "Two-Process Model of Alertness" to visualize your circadian rhythm and energy levels.
The project has been unified to use the latest sleep research and high-precision algorithms across both platforms.
-
Research-Standard Model: Updated the Two-Process model constants to 2024 performance standards (
$\tau_{wake}$ = 23.0h,$\tau_{sleep}$ = 4.0h) for a more resilient and accurate energy curve. - Precision Bathyphase: Implemented a Parabolic Vertex Fit for heart rate nadir detection, providing sub-hour accuracy for circadian anchoring.
- Dynamic Acrophase: Both apps now scan your personalized curve to identify and display your true peak alertness point (Acrophase).
- Unified Efficiency: Standardized "Average of Ratios" logic for sleep efficiency. Naps are now strictly used for debt reduction only, ensuring your baseline sleep need remains stable.
- Visual Synchronization: Identical visual indicators (inward triangles) for key circadian events are now present on both the Android wallpaper and Python widget.
- /android: The Android application project (Kotlin/Compose).
- /python: The Python desktop widget application.
To protect privacy and API keys, this project uses modular configuration files that are ignored by version control. You must create these files locally to enable health and calendar integrations.
You need to register a "Personal" application on dev.fitbit.com to access your heart rate and sleep data.
- Android Setup:
- Open
local.propertiesat the project root (seelocal.properties.example). - Add your credentials:
FITBIT_CLIENT_ID=your_id FITBIT_CLIENT_SECRET=your_secret
- Open
- Python Setup:
- Create
python/fitbit_config.json(seepython/fitbit_config.json.example). - Add your credentials:
{ "FITBIT_CLIENT_ID": "your_id", "FITBIT_CLIENT_SECRET": "your_secret" }
- Create
- Create a "Desktop Application" client ID in the Google Cloud Console.
- Download the JSON and save it as
python/credentials.json(seepython/credentials.json.example).
- Open the root folder in Android Studio.
- Ensure your
local.propertiesis populated (as shown above). - Build and deploy to your device.
- Navigate to the
python/directory. - Install dependencies:
pip install -r requirements.txt. - Ensure
fitbit_config.json(and optionallycredentials.json) are present in thepython/folder. - Run the app:
python clock_widget.py.
For detailed information on the math and features of each component, see: