#!/bin/bash

cpu() {
    awk '/^cpu / {
        usage = ($2 + $4) * 100 / ($2 + $4 + $5)
        printf "%.1f%%", usage
    }' /proc/stat
}

mem() {
    free | awk '/Mem:/ {
        used = $3 / $2 * 100
        printf "%.1f%%", used
    }'
}

localip() {
    sb-network
}

vol() {
    sb-volume
}

charging() {
    bat-symbol
}

get_time() {
    date '+%I:%M-%p'
}

echo "[$(vol)] [$(cpu)] [$(mem)] $(charging) [$(get_time)]"

