
I built a water reminder plugin for JetBrains and VS Code — here's how and why
I built a water reminder plugin for JetBrains and VS Code The problem I spend most of my day inside WebStorm. I code, debug, think, and repeat — and I constantly forget to drink water. Phone notifications break my focus, external apps feel like overkill. I searched the JetBrains Marketplace and found nothing that did it in a simple, clean way. So I built it myself. Building the JetBrains plugin The JetBrains plugin ecosystem is based on the IntelliJ Platform SDK , and plugins are written in Kotlin . The timer service The core of the plugin is a background timer that fires a notification every X minutes: fun start () { val settings = WaterReminderSettings . getInstance (). state if (! settings . enabled ) return scheduler = Executors . newSingleThreadScheduledExecutor () scheduler ?. scheduleAtFixedRate ( { try { showNotification () } catch ( e : Exception ) { e . printStackTrace () } }, settings . intervalMinutes . toLong (), settings . intervalMinutes . toLong (), TimeUnit . MINUTES )
Continue reading on Dev.to Webdev
Opens in a new tab




