💾 Archived View for gemini.cyberbot.space › gemlog › aux › tmuxstatusscripts.gmi captured on 2022-04-29 at 12:22:40. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

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

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