#!/usr/bin/env bash

# Date
date=$(date "+%I:%M %p")

# CPU temp
cpu=$(sensors | grep "Package" | cut -f 1-3,5 -d " ")

# Alsa master volume
volume=$(amixer get Master | grep "Right:" | cut -f 7,8 -d " ")

# Battery percentage
batt=""
for b in /sys/class/power_supply/BAT*; do
    if [ -d "$b" ]; then
        if [ -r "$b/capacity" ]; then
            cap=$(<"$b/capacity")
        else
            cap=0
        fi
        if [ -z "$batt" ]; then
            batt="${cap}%"
        else
            batt="$batt ${cap}%"
        fi
    fi
done
# If no battery found
if [ -z "$batt" ]; then
    batt="None"
fi

# Status bar
echo "BAT: $batt | $date"

