6 lines
196 B
Bash
Executable File
6 lines
196 B
Bash
Executable File
#!/bin/bash
|
|
acpi | head -n 1 | awk '{pct = substr($4, 1, length($4)-2);\
|
|
if($3 ~ "Dis") print "D"pct;\
|
|
else if($3 ~ "Cha") printf "C"pct;\
|
|
else print "F"substr($5, 1, length($5)-1);}'
|