1 0388c856 2025-03-12 boredpast #!/bin/sh
2 0388c856 2025-03-12 boredpast # some cool stats for the tmux bar on openbsd
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"
8 0388c856 2025-03-12 boredpast sndioctl -n output.level | awk '{ printf "%d%%\n", int($0*100) }'
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"
16 0388c856 2025-03-12 boredpast sndioctl -n input.level | awk '{ printf "%d%%\n", int($0*100) }'
20 0388c856 2025-03-12 boredpast bat () {
24 0388c856 2025-03-12 boredpast lidaction () {
25 0388c856 2025-03-12 boredpast [ "$(sysctl -n machdep.lidaction)" -eq 1 ] && printf "on" || printf "off"
28 0388c856 2025-03-12 boredpast temp () {
29 0388c856 2025-03-12 boredpast sysctl -n hw.sensors.cpu0.temp0 | awk '{ print $1, "C" }'
32 0388c856 2025-03-12 boredpast echo "|mic: $(mic)|vol: $(vol)|bat: $(bat)%|temp: $(temp)|lid: $(lidaction)|"