diff --git a/README.md b/README.md index a7f86ab..6848a49 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ npm i npm run make ``` -2. Unzip `out/make/zip/darwin/arm64/Battery Status-darwin-arm64-2024.1.0.zip` +2. Unzip `out/make/zip/darwin/arm64/Battery Status-darwin-arm64-#.#.#.zip` 3. Move `Battery Status.app` to the `Applications` folder 4. (Optional) Add `Battery Status.app` in `System Settings` > `General` > `Login Items` > `+` to run `Battery Status` on computer startup 5. Run `Battery Status.app` diff --git a/package.json b/package.json index 09c16ba..589e1ad 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "productName": "Battery Status", "name": "battery-status", - "version": "2024.1.0", + "version": "2024.7.0", "description": "Program that notifies the user when it's time to plug in or unplug the laptop to maximize the battery life", "license": "LGPL-3.0-or-later", "author": { diff --git a/renderer.js b/renderer.js index c6ee7fe..c9970d0 100644 --- a/renderer.js +++ b/renderer.js @@ -27,18 +27,18 @@ function main() { navigator.getBattery().then((batteryManager) => { batteryManager.addEventListener("levelchange", (_event) => { - const level = batteryManager.level * 100; + const level = Math.round(batteryManager.level * 100); if (batteryManager.charging) { if (level >= 80) { - sendNotification("Battery sufficiently charged"); + sendNotification(`You might want to unplug your PC (${level}%)`); } return; } if (level <= 20) { - sendNotification(`Low Battery: ${level}% battery remaining`); + sendNotification(`You might want to plug in your PC (${level}%)`); } }); });