Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Battery AlertNew to Visual Studio Code? Get it now.
Battery Alert

Battery Alert

SaladStik

|
4 installs
| (0) | Free
Alerts you when your battery level falls below a configurable threshold
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Battery Alert for VS Code

A VS Code extension that monitors your battery level and alerts you when it falls below a configurable threshold.

Features

  • Battery Monitoring: Automatically checks your battery level at regular intervals
  • Low Battery Alerts: Shows a warning notification when battery drops below the threshold
  • Status Bar Display: Shows current battery percentage in the status bar
  • Configurable Settings: Customize threshold and check interval
  • Cross-Platform: Works on macOS, Windows, and Linux

Commands

  • Battery Alert: Check Battery Now - Manually check the battery level
  • Battery Alert: Show Battery Status - Display current battery status

Extension Settings

This extension contributes the following settings:

Setting Default Description
batteryAlert.threshold 20 Battery percentage threshold below which to show an alert (5-100)
batteryAlert.checkInterval 60 How often to check the battery level in seconds (10-600)
batteryAlert.enabled true Enable or disable battery alerts

Alert Frequency

Alerts fire at most once per 5% drop — so you'll be notified at 20%, 15%, 10%, and 5% (or whatever bands fall at or below your threshold). If VS Code starts while the battery is already mid-band (e.g. 14%), the alert still fires immediately since that value has crossed the nearest 5% boundary (15%). Plugging in resets the tracking so alerts resume correctly on the next discharge cycle.

How It Works

The extension uses native system commands to check battery status:

  • macOS: Uses pmset -g batt
  • Windows: Uses WMIC to query Win32_Battery
  • Linux: Uses upower or reads from /sys/class/power_supply/

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft