Repository navigation
battery.nvim v1.1.1
Note
v1.1.1 is the first published release since v1.0.0. It includes everything tagged in v1.1.0, plus a small documentation fix.
This release adds low battery notifications. It also removes the plenary dependency and the extra Linux/WSL code paths, and puts all modules and types under the battery namespace.
Warning
Breaking changes. Read the "Breaking changes" section if your config uses require('util.*'), the plugin's LuaLS types, or the acpi / wsl parsers.
✨ New features
Low battery notifications (#77)
battery.nvim can now warn you when your battery runs low. The check only runs while on battery power. You get one notification each time a threshold is crossed. Plugging in, or charging back above a threshold, resets it.
require('battery').setup({
notify_on_low_battery = true, -- default: false
low_battery_threshold = 20, -- WARN level
critical_battery_threshold = 10, -- ERROR level
notify_function = nil, -- optional fun(msg, level), defaults to vim.notify
})- Use
notify_functionto send notifications to something else, such asnvim-notify. - If
critical_battery_thresholdis not a number lower thanlow_battery_threshold,setup()shows a warning and turns notifications off.
Developer shell scripts (#68)
New scripts start a minimal, consistent Neovim for working on the plugin:
scripts/dev-shell.sh(Linux/macOS) andscripts/DevShell.ps1(Windows)nvim -u ./scripts/dev_init.lualoads the plugin, runssetup(), and adds the helpersBatteryStatus()andBatteryStatusLine().
💥 Breaking changes
Modules and types are namespaced (#64)
-
The
utilmodule is nowbattery.util. Update anyrequire('util.log'),require('util.timers'), etc. torequire('battery.util.log')and so on. -
LuaLS type annotations now have a
battery.prefix so they don't clash with other plugins:Old New BatteryStatusbattery.StatusConfigbattery.ConfigIconSetbattery.IconSetParserModulebattery.ParserModuleMultipleBatterySelectionbattery.MultipleBatterySelection
acpi parser removed (#76)
On Linux, battery info now comes only from /sys/class/power_supply. You no longer need the acpi package.
WSL parser removed (#71)
The WSL parser (cmd.exe /c powercfg.exe) is gone because it is no longer needed. WSL is still listed as supported, and it now uses the standard detection.
🔧 Improvements
- plenary.nvim removed (#63). Background jobs now use the built-in
vim.system. A simple logger utility was added, and the test suite runs with plain Lua assertions. The plugin and its tests no longer need anything outside Neovim. - nvim-web-devicons is no longer a documented dependency. The install snippets for Plug, lazy.nvim and Packer no longer list it.
- Code formatting cleanup (tabs changed to spaces, consistent string concatenation).
📚 Documentation
- README rewritten, with deprecated content removed (#65, #70).
- New install instructions for Neovim's built-in
vim.pack(#70). - New "Development" section in the README, and updates to
CONTRIBUTING.md(#68). doc/battery.txtcovers the new notification options.- Typo fixes ("diconnected" → "disconnected", and others).
- Removed a duplicate
multiple_battery_selectionline and an outdatedacpireference from the configuration example in the README anddoc/battery.txt(v1.1.1).
📄 License
- Now labelled MIT License (Expat), copyright 2022–2026 Justin Heyes-Jones and Contributors (#66).
Requirements
- Neovim v0.10.0+ (unchanged)
Full changelog: v1.0.0...v1.1.1