.dotfiles/.config/waybar/scripts/power-consumption

7 lines
193 B
Plaintext
Raw Normal View History

2022-05-24 14:48:23 +02:00
#!/bin/bash
echo - | awk "{printf \"%.1f\", \
$(( \
$(cat /sys/class/power_supply/BAT0/current_now) * \
$(cat /sys/class/power_supply/BAT0/voltage_now) \
)) / 1000000000000 }" ; echo "W "