batmon

BatMon - Monitor your Battery

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.2.4
License BSD-3-Clause
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • Paul Wilde

Installation

nimble install batmon
choosenim install batmon
git clone https://codeberg.org/pswilde/batmon

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
batmon - - - - - - -

Dependencies

Package Version Optional
nim >= 2.0.0 No

Source

Repository https://codeberg.org/pswilde/batmon
Homepage https://codeberg.org/pswilde/batmon
Registry Source nimble_official

README

BatMon

A simple battery monitor tool that can notify you on battery status changes for FreeBSD.
Inspired by but in no way similar to batsignal - inspiring the basic function only. Written in pure Nim.

Requirements

Run Requirements

  • apm
  • notify-send

Build Requirements

  • nim
  • nimble

Installation

To install into your .nimble/bin directory

git clone https://codeberg.org/pswilde/batmon && cd batmon
nimble install

Running

# To run the daemon server notifier, just run:
batmon -d

# To run once and just show battery level, run:
batmon -o

Using

When importing Batmon as a module you have access to the get_battery_status() procedure which will return a Battery object you can use elsewhere.

Battery Type

type 
  Battery* = object
    status*: Status
    charge*: float
  Status* = enum
    High,
    Low,
    Critical,
    Charging,
    Unknown

Also, you have access to the notification handler module, where you can build and send your own notifications:

var n = newNotification("Title", "Body", urgency = Normal , timeout = 5000)
discard n.send()

ToDo

[x] Add similar functionality for Linux systems [ ] Use libnotify instead of notify-send