mirror of
https://github.com/NotAShelf/batmon.git
synced 2025-02-22 03:18:04 +00:00
docs: expand nix installation; wording
This commit is contained in:
parent
60612360f8
commit
53d59bcd24
1 changed files with 44 additions and 24 deletions
68
README.md
68
README.md
|
@ -1,20 +1,19 @@
|
||||||
# 🔋 Batmon
|
# 🔋 Batmon
|
||||||
|
|
||||||
> **Batmon** is a dead-simple battery monitor for Linux written in Go. It
|
Dead-simple, somewhat configurable battery monitor for Linux. Batmon monitors
|
||||||
> provides real-time monitoring of battery status and adjusts the power profile
|
the battery path in real time and adjusts your power profiles accordingly to
|
||||||
> accordingly to optimize battery life.
|
optimize battery life for e.g. laptops.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Real-time monitoring of battery status
|
- Real-time monitoring of battery status
|
||||||
- Adjustment of power profile based on battery status
|
- Dynamic adjustment of power profiles
|
||||||
- Support for custom commands and extra commands
|
- Simple configuration though JSON configuration file
|
||||||
- Configuration via a JSON file
|
- Optional command execution on state changes
|
||||||
- Not written in Rust (the codebase is _readable_)
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
## Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- Upower
|
- Upower
|
||||||
- powerprofilesctl
|
- powerprofilesctl
|
||||||
|
@ -22,8 +21,33 @@
|
||||||
|
|
||||||
### Nix
|
### Nix
|
||||||
|
|
||||||
**Batmon** is primarily distributed through a Nix flake. You may install it
|
You are strongly encouraged to get Batmon through Nix, using the flake located
|
||||||
manually using `nix profile install github:NotAShelf/batmon`
|
in this repository. You may install it manually on non-NixOS systems using
|
||||||
|
`nix profile install`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix profile install github:NotAShelf/batmon
|
||||||
|
```
|
||||||
|
|
||||||
|
Or on NixOS systems using the package exposed for your system.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{inputs, pkgs, ...}: {
|
||||||
|
environment.systemPackages = [
|
||||||
|
inputs.batmon.packages.${pkgs.stdenv.system}.default
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, using the NixOS _module_ to install Batmon and configure a
|
||||||
|
systemd service for you.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{inputs, pkgs, ...}: {
|
||||||
|
imports = [inputs.batmon.nixosModules.default];
|
||||||
|
services.batmon.enable = true;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Manually
|
### Manually
|
||||||
|
|
||||||
|
@ -31,25 +55,21 @@ manually using `nix profile install github:NotAShelf/batmon`
|
||||||
go install . # this will install Batmon in your $GOPATH
|
go install . # this will install Batmon in your $GOPATH
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
Start Batmon through your terminal, or as a systemd service.
|
||||||
|
|
||||||
To start using Batmon, use the following command:
|
## Configuration
|
||||||
|
|
||||||
```
|
By default, Batmon will load the configuration from `config.json` located in the
|
||||||
batmon
|
current directory. You can specify a different configuration file using the
|
||||||
```
|
`--config` flag:
|
||||||
|
|
||||||
By default, Gomon will load the configuration from config.json in the current
|
|
||||||
directory. You can specify a different configuration file using the `--config`
|
|
||||||
flag:
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
batmon -c /path/to/config.json
|
batmon -c /path/to/config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
The configuration file should contain a list of batteries to monitor, along
|
The configuration file should contain a list of batteries to monitor, along with
|
||||||
with any custom commands or extra commands to execute. Here's an example of
|
any custom commands or extra commands to execute. Here's an example of a
|
||||||
a configuration file:
|
configuration file:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -63,8 +83,8 @@ a configuration file:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- You can leave `command` empty to use the default behaviour - which will
|
- You can leave `command` empty to use the default behaviour - which will switch
|
||||||
switch active powerprofile using `powerprofiles set performance | balanced`
|
active powerprofile using `powerprofiles set performance | balanced`
|
||||||
|
|
||||||
- `extraCommand`, if provided, will be executed in addition to the `command`
|
- `extraCommand`, if provided, will be executed in addition to the `command`
|
||||||
value.
|
value.
|
||||||
|
|
Loading…
Add table
Reference in a new issue