diff options
| author | Saumit <justsaumit@protonmail.com> | 2025-12-23 05:40:51 +0530 |
|---|---|---|
| committer | Saumit <justsaumit@protonmail.com> | 2025-12-23 05:40:51 +0530 |
| commit | c406150719e2c4dddcc56a78845c1d3675980687 (patch) | |
| tree | 7bc11a7cc30f4d57b420c5ed32c2bdc4190db151 | |
| parent | d14d0474c163cb8c3395feb67d8d4a4d399fdaa9 (diff) | |
| -rw-r--r-- | .config/systemd/user/eye-rest-reminder.service | 14 | ||||
| -rwxr-xr-x | .scripts/20-20-20.sh | 53 |
2 files changed, 67 insertions, 0 deletions
diff --git a/.config/systemd/user/eye-rest-reminder.service b/.config/systemd/user/eye-rest-reminder.service new file mode 100644 index 0000000..f4cd795 --- /dev/null +++ b/.config/systemd/user/eye-rest-reminder.service @@ -0,0 +1,14 @@ +[Unit] +Description=20-20-20 Eye Rest Reminder +After=graphical-session.target + +[Service] +Type=simple +ExecStart=%h/.scripts/20-20-20.sh +Restart=always +RestartSec=10 +Environment=DISPLAY=:0 +Environment=WAYLAND_DISPLAY=wayland-1 + +[Install] +WantedBy=default.target diff --git a/.scripts/20-20-20.sh b/.scripts/20-20-20.sh new file mode 100755 index 0000000..2179643 --- /dev/null +++ b/.scripts/20-20-20.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# 20-20-20 Eye Rest Reminder for Hyprland +# Every 20 minutes, shows a full-screen blocking reminder for 20 seconds + +INTERVAL=1200 # 20 minutes in seconds +DURATION=20 # 20 seconds break + +while true; do + sleep $INTERVAL + + # Show notification warning + notify-send -u critical -t 3000 "👁️ 20-20-20 EYE BREAK" "Eye break starting in 3 seconds..." + + sleep 3 + + # Create full-screen blocking overlay using yad + # Install: sudo pacman -S yad + yad --width=1920 --height=1080 \ + --center \ + --undecorated \ + --no-buttons \ + --timeout=$DURATION \ + --timeout-indicator=top \ + --skip-taskbar \ + --on-top \ + --sticky \ + --fixed \ + --title="Eye Break" \ + --text="<span font='64' weight='bold' foreground='#eb6f92'>👁️ EYE BREAK TIME 👁️</span> + +<span font='32' foreground='#e0def4'>Look at something <b>20 FEET</b> away (6 meters)</span> + +<span font='32' foreground='#e0def4'>For <b>20 SECONDS</b></span> + +<span font='28' foreground='#9ccfd8'>🪑 Stand up and look away from the screen</span> + +<span font='20' foreground='#6e6a86'>This window will close automatically...</span>" \ + --text-align=center \ + --back=1f1d2e \ + --borders=50 & + + YAD_PID=$! + + # Wait for the duration + sleep $DURATION + + # Kill yad if still running + kill $YAD_PID 2>/dev/null + + # Show completion notification + notify-send -u normal -t 3000 "✅ Eye Break Complete" "Great job! Back to work 💪" +done |
