Blame view

README.md 642 Bytes
43dd9f49   Miguel Barão   add makefile and ...
1
# Battery indicator for tmux/FreeBSD
9a5368c2   Miguel Barão   Add README.md file
2

5c3ac220   Miguel Barão   Small update
3
This is is a little C program to indicate the current battery state and
43dd9f49   Miguel Barão   add makefile and ...
4
5
percentage in the tmux status bar.
It uses the FreeBSD `sysctl` and is not compatible with Linux.
9a5368c2   Miguel Barão   Add README.md file
6

43dd9f49   Miguel Barão   add makefile and ...
7
Requires a font that includes utf-8 symbols. Iosevka and JetBrains Mono from
5c3ac220   Miguel Barão   Small update
8
NerdFonts have been tested.
43dd9f49   Miguel Barão   add makefile and ...
9
10

Compile with
9a5368c2   Miguel Barão   Add README.md file
11

43dd9f49   Miguel Barão   add makefile and ...
12
13
```sh
cc -O2 battery.c -o battery
5c3ac220   Miguel Barão   Small update
14
```
d8824a52   Miguel Barão   Add gitignore
15

9a5368c2   Miguel Barão   Add README.md file
16
17
and copy or link the executable into `~/.local/bin`, which should be on your
`$PATH`.
43dd9f49   Miguel Barão   add makefile and ...
18

9a5368c2   Miguel Barão   Add README.md file
19
Edit `~/.tmux.conf` and setup the status bar with something like
d8824a52   Miguel Barão   Add gitignore
20
21
22
23

```tmux
set-option -g status-right "#($HOME/.local/bin/battery)   %a, %d %b  %H:%M "
```