Archived: Please use hovancik/stretchly as a much better alternative.
A simple bash script implementing the 20-20-20 rule for eye care: every 20 minutes, take a 20-second break and look at something 20 feet (6 meters) away.
- System Tray Icon: Runs in the background with a system tray icon
- Pause/Resume: Right-click menu to pause and resume reminders
- Audio Alerts: Plays sound notifications at the start and end of breaks
- Visual Notifications: Desktop notifications to remind you to take breaks
- Auto-start Support: Desktop file for easy launching from application menu
Required:
notify-send(libnotify)yad(Yet Another Dialog - for system tray icon)mpv(for audio playback)
Installation on Ubuntu/Debian:
sudo apt install libnotify-bin yad mpvInstallation on Arch Linux:
sudo pacman -S libnotify yad mpvInstallation on Fedora:
sudo dnf install libnotify yad mpvsudo make installThis installs to /usr/local by default. To install to a different location:
sudo make install PREFIX=/usrmake user-installThis installs to ~/.local. Make sure ~/.local/bin is in your PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc./20-20-rule.shAfter installation, you can:
- Launch from terminal:
20-20-rule - Launch from application menu: Search for "20-20-20 Rule" or "20-20-20 护眼提醒"
- Control via tray icon: Right-click the tray icon to pause/resume or exit
- Left-click: (Reserved for future use)
- Right-click: Open menu
- Pause: Temporarily stop reminders
- Resume: Restart reminders
- Exit: Close the application
sudo make uninstallmake user-uninstallYou can customize the timing by editing the script variables:
PERIOD_MINUTES: Time between reminders (default: 20 minutes)BREAK_SECONDS: Duration of each break (default: 20 seconds)
The 20-20-20 rule is a simple technique to reduce eye strain:
- Every 20 minutes
- Look at something 20 feet (6 meters) away
- For at least 20 seconds
This helps reduce eye fatigue when working on computers or screens for extended periods.
The original simple script scriptReminder.sh is still available for those who prefer a minimal implementation without system tray support.
- This project is originally a fork of ShahzamanRai/20-20-Rule.
- It's mainly written by AI (with manually testing and tweaking later).
MIT License