Blame


1 0388c856 2025-03-12 boredpast #!/bin/sh
2 0388c856 2025-03-12 boredpast # some cool stats for the tmux bar on openbsd
3 0388c856 2025-03-12 boredpast
4 0388c856 2025-03-12 boredpast vol () {
5 0388c856 2025-03-12 boredpast if [ "$(sndioctl -n output.mute)" -eq 1 ]; then
6 0388c856 2025-03-12 boredpast echo "muted"
7 0388c856 2025-03-12 boredpast else
8 0388c856 2025-03-12 boredpast sndioctl -n output.level | awk '{ printf "%d%%\n", int($0*100) }'
9 0388c856 2025-03-12 boredpast fi
10 0388c856 2025-03-12 boredpast }
11 0388c856 2025-03-12 boredpast
12 0388c856 2025-03-12 boredpast mic () {
13 0388c856 2025-03-12 boredpast if [ "$(sysctl -n kern.audio.record)" -eq 1 ] || [ "$(sndioctl -n input.mute)" -eq 1 ]; then
14 0388c856 2025-03-12 boredpast printf "muted"
15 0388c856 2025-03-12 boredpast else
16 0388c856 2025-03-12 boredpast sndioctl -n input.level | awk '{ printf "%d%%\n", int($0*100) }'
17 0388c856 2025-03-12 boredpast fi
18 0388c856 2025-03-12 boredpast }
19 0388c856 2025-03-12 boredpast
20 0388c856 2025-03-12 boredpast bat () {
21 0388c856 2025-03-12 boredpast apm -l
22 0388c856 2025-03-12 boredpast }
23 0388c856 2025-03-12 boredpast
24 0388c856 2025-03-12 boredpast lidaction () {
25 0388c856 2025-03-12 boredpast [ "$(sysctl -n machdep.lidaction)" -eq 1 ] && printf "on" || printf "off"
26 0388c856 2025-03-12 boredpast }
27 0388c856 2025-03-12 boredpast
28 0388c856 2025-03-12 boredpast temp () {
29 0388c856 2025-03-12 boredpast sysctl -n hw.sensors.cpu0.temp0 | awk '{ print $1, "C" }'
30 0388c856 2025-03-12 boredpast }
31 0388c856 2025-03-12 boredpast
32 0388c856 2025-03-12 boredpast echo "|mic: $(mic)|vol: $(vol)|bat: $(bat)%|temp: $(temp)|lid: $(lidaction)|"