Gitiles
Code Review
Sign In
git.clicks.codes
/
Chimera
/
NixFiles
/
9322df4a11f43d8b2d69e903b7334de0f341bfe9
/
.
/
modules
/
home
/
eww
/
config
/
scripts
/
cpu_usage
blob: 62d9af7ffb7b26cb308d3505e8d48f657be8c2c2 [
file
] [
log
] [
blame
]
CPU
=
$
(
sed
-
n
's/^cpu\s//p'
/
proc
/
stat
);
TOTAL
=
$
((
$
(
T
=
0
;
for
VAL
in
$CPU
;
do
T
=(
$
((
T
))+
$
((
VAL
)));
done
;
echo $T
)));
IDLE
=
$
{
CPU
[
4
]};
IDLE_FRAC
=
$
(
echo $
((
$IDLE
.
00
/
$TOTAL
)));
IN_USE
=
$
(
echo $
((
1.00
-
$IDLE_FRAC
)));
NUM
=
$
((
$IN_USE
*
100
));
echo $NUM