Skip to content

Omerkaygisiz/eyeguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘๏ธ EyeGuard

EyeGuard Main Screen

A smart eye break reminder that enforces the 20-20-20 rule using real-time camera head tracking

Python Platform License MediaPipe


๐Ÿ“– What is the 20-20-20 Rule?

Every 20 minutes, look at something 20 feet away for 20 seconds. This rule reduces eye fatigue and digital eye strain.

EyeGuard automates this โ€” when break time comes, it locks your screen and uses your camera to verify you're actually looking away.


โœจ Features

Feature Description
๐Ÿ“ท Camera Tracking Uses MediaPipe to measure head angle and verify you're looking away
๐Ÿ”” Sound Alerts Customizable sounds 60s before, at start, and at end of each break
๐Ÿ“Š Statistics Daily/weekly break history with GitHub-style calendar heatmap
๐ŸŽฎ Game Mode Pause breaks for a set duration or indefinitely
๐Ÿ• Scheduler Enable/disable by day and time range
๐Ÿš€ Auto-start Launches automatically at Windows startup
๐ŸŒ Bilingual Turkish and English support
๐ŸŽจ Modern UI Dark theme, fullscreen panel

๐Ÿ–ฅ๏ธ Screenshots

Main Panel ย  Statistics

Scheduler ย  Settings

Game Mode ย  Tray Menu


๐Ÿš€ Installation

Ready-to-use EXE (Recommended)

  1. Download EyeGuard.exe from the Releases page
  2. Place the notifications folder in the same directory as the EXE
  3. Double-click to run

Run with Python

Requirements:

  • Python 3.12
  • Windows 10/11
# Clone the repo
git clone https://github.com/Omerkaygisiz/eyeguard.git
cd eyeguard

# Create virtual environment (recommended)
python -m venv venv
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run
python eyeguard.py

Build EXE

pip install pyinstaller
pyinstaller eyeguard.spec
# EyeGuard.exe will be in the dist/ folder

๐Ÿ“ File Structure

eyeguard/
โ”œโ”€โ”€ eyeguard.py             # Main application
โ”œโ”€โ”€ eyeguard.spec           # PyInstaller configuration
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ notifications/          # Sound files
โ”‚   โ”œโ”€โ”€ warning.wav         # 60s warning sound
โ”‚   โ”œโ”€โ”€ break.wav           # Break start sound
โ”‚   โ””โ”€โ”€ done.mp3            # Break complete sound
โ”œโ”€โ”€ eyeguard_stats.json     # Statistics data (auto-created)
โ””โ”€โ”€ eyeguard_schedule.json  # Schedule settings (auto-created)

โš™๏ธ Settings

Setting Default Description
Work Duration 20 min Time between breaks
Break Duration 20 sec How long to look away
Sensitivity Medium Head turn angle threshold

Sensitivity options:

  • Wide โ€” Triggers only on large head movements
  • Medium โ€” Balanced
  • Narrow โ€” Triggers on small movements

๐Ÿ”ง Technical Details

  • Head tracking: MediaPipe Face Mesh โ€” yaw/pitch via 2D landmark geometry
  • UI: Tkinter + Canvas
  • Tray: pystray
  • Audio: pygame
  • Data: JSON files

๐Ÿค Contributing

Pull requests are welcome!

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0.

In short: you can use, modify, and distribute this software โ€” but derivative works must also be GPL-licensed.


๐Ÿ‘จโ€๐Ÿ’ป Developer

ร–mer Kaygฤฑsฤฑz โ€” GitHub


Protect your eyes ๐Ÿ‘๏ธ

About

๐Ÿ‘๏ธ Smart eye break reminder using the 20-20-20 rule with real-time camera head tracking

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages