battery level check thingy
This commit is contained in:
parent
074866f91e
commit
fc5a75071a
10
bat
Executable file
10
bat
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Shows current battery level from BAT0
|
||||
# also a script to show off some tricks(hopefully)
|
||||
|
||||
raw=`echo -n ' / ' | cat /sys/class/power_supply/BAT0/energy_now - /sys/class/power_supply/BAT0/energy_full | tr -d '\n'`
|
||||
|
||||
digits=$(echo $raw | bc -l)
|
||||
digits=${digits##.}
|
||||
echo Battery %${digits:0:2}.${digits:3:2}
|
Loading…
Reference in New Issue
Block a user