Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Vahid Code BreakNew to Visual Studio Code? Get it now.
Vahid Code Break

Vahid Code Break

Vahid Code

|
1 install
| (0) | Free
Gentle eye-care and movement break reminders while you work in VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Vahid Code Break

Gentle reminders to rest your eyes and get out of your chair while you work in VS Code.

  • Eye break every 20 minutes: look at something far away for 20 seconds.
  • Movement break every 60 minutes: stand up and move around.

Timers start automatically when VS Code starts. Reminders are ordinary VS Code notifications, mirrored as a desktop notification of the operating system so you also see them in another application; nothing blocks the editor or opens a window.

Using it

Each reminder offers three actions:

Action Effect
Done Starts the next interval from now.
Remind me later Reminds you again in 5 minutes (configurable).
Pause reminders Opens the pause menu.

When the break is over, an alarm sound and a short status bar message tell you to come back: 20 seconds after an eye reminder and 5 minutes after a movement reminder by default. Answering the reminder with any of the three actions cancels that alarm.

If you ignore a reminder, the next one of the same kind does not stack a second notification; it shows briefly in the status bar instead.

Desktop notifications

Each reminder, and the end of each break, also appears as a notification of the operating system. reminders.systemNotification controls when: always (default), unfocused (only while VS Code is not the focused application) or off. The desktop notification has no buttons; answer the reminder in VS Code.

Run Eye Care: Test System Notification to see one right away.

The status bar shows the time to the next breaks, for example 👀 12m 🚶 42m, or ⏸ Paused 14m while paused. Click it for a menu with pause/resume, reset, status and settings.

Commands

All commands are in the Command Palette under Eye Care:

Command Description
Eye Care: Pause Reminders Choose a pause duration (15 min, 30 min, 1 h, 2 h, or until resumed).
Eye Care: Pause for 15 Minutes / 30 Minutes / 1 Hour / 2 Hours Pause without the menu.
Eye Care: Resume Reminders End the pause now.
Eye Care: Show Status Show time to the next breaks and the pause state.
Eye Care: Reset Timers Restart both countdowns from their full interval.
Eye Care: Choose Sound Pick the sound of a reminder; each sound plays as you move through the list.
Eye Care: Preview Sounds Listen to the bundled sounds without changing anything.
Eye Care: Reset Settings Return every setting of this extension to its default (asks first).
Eye Care: Test System Notification Show a sample desktop notification.
Eye Care: Show Menu The same menu the status bar item opens.

A pause applies to both reminders. Countdowns freeze while paused and continue from where they stopped. A timed pause ends on its own, and the pause survives a window reload or restart.

Screen lock

Locking the screen stops the countdowns in every window, and the status bar shows 💤 Away. They continue once the screen is unlocked and a VS Code window has focus again, not at the unlock itself. An absence at least as long as a reminder's break counts as that break taken, so its countdown starts over: any lock of 20 seconds or more restarts the eye countdown, 5 minutes or more the movement one (with the default break lengths). A shorter lock continues from where it stopped. A break-end alarm still pending when the screen locks is dropped.

The lock is read from GNOME's screensaver signal (gdbus), or from systemd-logind's LockedHint (loginctl, polled every five seconds) where that signal is missing. On macOS, Windows, or a Linux desktop that reports neither, the countdowns keep running while locked. Turn it off with reminders.pauseWhenLocked.

Multiple windows and profiles

All VS Code windows on the machine share one schedule, including windows in different profiles or started with a different --user-data-dir. The schedule and the pause state are stored in ~/.vahid-code-break/.

  • Every window shows the same countdown.
  • Each reminder appears once: in the focused window, or in one of the open windows if none has focus.
  • Pause, resume, reset, Done and Remind me later in any window apply to all of them, within about two seconds.
  • Closing a window does not interrupt the countdown.

Settings are still per profile. A profile with a reminder disabled never shows it. If profiles use different intervals, each new cycle uses the interval of the window that showed the reminder, so keep them the same.

Settings

Setting Default Description
eyeCare.enabled true Enable eye-care reminders.
eyeCare.interval 20 Minutes between eye-care reminders.
eyeCare.sound glass Sound of the eye-care reminder, or off.
eyeCare.breakSeconds 20 Length of the eye break in seconds.
eyeCare.messages 8 Persian lines Eye reminder texts; one is picked at random each time.
eyeCare.breakEndMessages 2 Persian lines Texts for the end of the eye break, picked at random.
movementReminder.enabled true Enable movement reminders.
movementReminder.interval 60 Minutes between movement reminders.
movementReminder.sound chime Sound of the movement reminder, or off.
movementReminder.breakMinutes 5 Length of the movement break in minutes.
movementReminder.messages 8 Persian lines Movement reminder texts; one is picked at random each time.
movementReminder.breakEndMessages 2 Persian lines Texts for the end of the movement break, picked at random.
reminders.sound true Master switch for reminder sounds.
reminders.soundVolume 60 Sound volume, 0–100.
reminders.breakEndAlarm false Signal the end of each break.
reminders.breakEndSound success Alarm sound for the end of a break, or off.
reminders.snoozeMinutes 5 Delay used by "Remind me later".
reminders.minGapMinutes 10 Least time between the eye-care and the movement reminder; the later one moves back. 0 lets them coincide.
reminders.pauseWhenLocked true Stop the countdowns while the screen is locked; see Screen lock.
reminders.showStatusBar true Show the countdown in the status bar.
reminders.workHours.enabled false Run reminders only inside the working window below.
reminders.workHours.start 09:00 Start of the working window, 24-hour HH:MM, local time.
reminders.workHours.end 18:00 End of the working window. Earlier than the start runs overnight; equal to it means all day.
reminders.systemNotification always Desktop notification with each reminder: off, unfocused or always.
reminders.systemNotificationBreakEnd true Also show the end of a break as a desktop notification.
reminders.systemNotificationSeconds 10 Seconds a desktop notification stays on screen; 0 keeps it until dismissed. Linux only.

Ten sounds are bundled: Chime, Ding, Glass, Success, Alert, Knock, Pop, Bubble, Marimba and Doorbell. In the Settings editor, each sound setting has ▶ links that play a sound when clicked, and the last setting has a link that resets everything to defaults.

Each message list is edited in the Settings editor with Add Item, or in settings.json as an array of strings. The same message is never shown twice in a row. Blank lines are ignored, and an empty list brings back the defaults.

Changes apply immediately. When an interval changes, time already elapsed in the current cycle is kept (20 → 30 minutes with 12 minutes elapsed leaves 18 minutes).

With work hours on, nothing counts down outside the window and the status bar shows 🌙 Off until 09:00. A reminder that would have fallen due after the end is dropped, not shown the next morning; the countdown starts fresh when the window opens. The start is inclusive and the end exclusive.

Intervals must be between 1 and 1440 minutes. Zero, negative and non-numeric values fall back to the default; larger values are capped at 1440.

Limitations

  • Sound is best effort. VS Code has no audio API for extensions, so the extension plays its bundled WAV files through a system player (afplay on macOS, PowerShell on Windows, paplay, pw-play or aplay on Linux). If none is available, reminders are silent. Windows ignores the volume setting.
  • Desktop notifications are best effort too: notify-send on Linux, osascript on macOS, a PowerShell toast on Windows. If the tool is missing, only the VS Code notification appears. Some Linux desktops (GNOME) ignore the on-screen time; 0 still keeps the notification until dismissed.

Development

Requirements: Node.js 20.4 or newer, VS Code 1.85 or newer.

npm install
npm run compile

Run in the Extension Development Host

  1. Open this folder in VS Code.
  2. Press F5 (or Run and Debug → Run Extension). This compiles the project and opens a second VS Code window with the extension loaded.
  3. In that window, check the status bar countdown and run Eye Care: Show Status from the Command Palette.

To see a reminder quickly, set eyeCare.interval to 1 in the development window's settings. Use npm run watch to recompile on save, then Developer: Reload Window in the development window.

Tests

npm test

Tests use Node's built-in test runner with fake timers and cover TimerManager, PauseService, SharedStore, settings validation, and ReminderManager across several simulated windows. They do not need VS Code.

Package and install locally

npx @vscode/vsce package          # or, without vsce: python3 scripts/build-vsix.py
code --install-extension vahid-code-break-1.8.0.vsix

Architecture

src/
├── extension.ts               activation: builds and wires the services
├── constants.ts               command ids and defaults
├── sounds.ts                  catalog of bundled sounds
├── managers/
│   ├── TimerManager.ts        one countdown; the only place timers are created
│   └── ReminderManager.ts     one TimerManager per reminder, aligned with the shared schedule
├── services/
│   ├── ConfigurationService.ts  reads, validates and watches settings
│   ├── NotificationService.ts   VS Code notifications, mirrored to the desktop
│   ├── LockMonitor.ts           screen lock state (GNOME signal, logind fallback)
│   ├── PauseService.ts          global pause, persisted, auto-resume
│   ├── SharedStore.ts           state shared by all windows (~/.vahid-code-break)
│   ├── SoundService.ts          plays the bundled sounds
│   ├── StatusBarService.ts      status bar countdown
│   └── SystemNotificationService.ts  desktop notifications of the operating system
├── commands/commands.ts       Command Palette commands and menus
├── utils/validation.ts        setting validation and duration formatting
├── utils/workHours.ts         the daily working window
├── types/index.ts
└── test/                      unit tests
  • TimerManager does not import vscode. It reports through onTick and onComplete callbacks and tracks remaining time against a wall-clock deadline, so the countdown stays correct after system sleep.
  • The eye and movement reminders each have their own TimerManager. PauseService uses a third, non-repeating one for auto-resume.
  • SharedStore keeps each reminder's due time and the pause state as small JSON files and polls them every two seconds. There is no leader window: every window counts down to the same due time.
  • ReminderManager.sync() is idempotent: on any settings, pause or shared-state change it brings each timer to the required state. When a reminder is due, the focused window claims it at once with an exclusive file create; unfocused windows try 1.5 seconds later, so exactly one window shows it.
  • Everything that holds a timer, listener or UI element is registered in context.subscriptions and disposed on deactivation.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft