💾 Archived View for gemini.cyberbot.space › gemlog › aux › tmuxstatusscripts.gmi captured on 2022-03-01 at 15:14:06. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

sparkcpu.sh

#!/bin/bash
IDLE=$(mpstat 1 1 | tail -n 1 | awk '{ print $11 }' | tail -n 1 | awk '{print ($0-int($0)<0.499)?int($0):int($0)+1}')
CPUU=$(expr 100 - $IDLE)
spark $CPUU 0 100 | cut -c -3

sparkmem.sh

#!/bin/bash
total=$(free -m | awk '/^Mem/ {print $3}')
spark $total 0 1992 | cut -b -3

bstat.sh

#!/bin/sh
percentage=$(cat /sys/class/power_supply/axp20x-battery/capacity)
status=$(cat /sys/class/power_supply/axp20x-battery/status)
bgauge=$(spark $percentage 0 100 | cut -c -3)
indicator="ï–ˆ"
if
[ $status == "Charging" ]; then
echo $bgauge $indicator
else
echo $bgauge
fi