Files
dotfiles/.config/fish/functions/battery_capacity.fish
2026-01-22 22:54:47 +01:00

13 lines
341 B
Fish

function battery_capacity
pushd /sys/class/power_supply/
for dir in ( ls | rg BAT | cut -d" " -f1)
pushd $dir &&
cat energy_full | read x &&
cat energy_full_design | read y &&
echo "capacity % of $dir compared to design capacity"
kalker $x/$y &&
popd
end
popd
end