Add some fun battery scripts
This commit is contained in:
parent
9954a27a64
commit
c68b08d692
|
@ -52,4 +52,5 @@ paru -Sy --needed --noconfirm \
|
||||||
gnu-netcat socat websocat `# Socket Utilities` \
|
gnu-netcat socat websocat `# Socket Utilities` \
|
||||||
nnn `# CLI File Manager` \
|
nnn `# CLI File Manager` \
|
||||||
avahi nss-mdns `# mDNS and Network Discovery Utilities` \
|
avahi nss-mdns `# mDNS and Network Discovery Utilities` \
|
||||||
|
git git-lfs `# Version Control` \
|
||||||
man-db man-pages `# Come On, Man!`
|
man-db man-pages `# Come On, Man!`
|
||||||
|
|
6
os/linux/bin/batmon
Executable file
6
os/linux/bin/batmon
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
while true
|
||||||
|
echo (date +%s)' '(batteries-combined-wattage) >> ~/.battlog
|
||||||
|
sleep 5
|
||||||
|
end
|
3
os/linux/bin/batteries-combined-wattage
Executable file
3
os/linux/bin/batteries-combined-wattage
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
cat /sys/class/power_supply/BAT*/power_now | rg . | awk '{print $1*10^-6}' | awk '{sum+=$1}END{print sum}'
|
5
os/linux/bin/batteries-watts
Executable file
5
os/linux/bin/batteries-watts
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
for b in /sys/class/power_supply/BAT*/power_now
|
||||||
|
cat $b | rg . | awk '{print $1*10^-6 " W"}'
|
||||||
|
end
|
9
os/linux/bin/battplot
Executable file
9
os/linux/bin/battplot
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env fish
|
||||||
|
echo '
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%s"
|
||||||
|
set format x "%H:%M:%S"
|
||||||
|
# set yrange[0:96]
|
||||||
|
while (1) { plot "/home/daniel/.home/.battlog" using 1:2 with linespoints
|
||||||
|
pause 5 }
|
||||||
|
' | gnuplot
|
Reference in a new issue