fixed min max value
This commit is contained in:
parent
32e0b3ec4d
commit
64fd020216
|
@ -5,11 +5,11 @@ load=$(cut -d" " -f1 /proc/loadavg)
|
|||
gpu=$(nvidia-smi -q -d Utilization -i 0 | head -n 11 | tail -n 1 | cut -d" " -f35)
|
||||
|
||||
#calculate speed, avg load, r, g, b
|
||||
pout=($(python3 -c "p=($load/16); print(int((p)*4)+1, int(p), int(p*255), int((1-p)*255))"))
|
||||
pout=($(python3 -c "p=min(max(($load/16), 0), 1); print(int((p)*4)+1, int(p), int(p*255), int((1-p)*255))"))
|
||||
speed=${pout[0]}
|
||||
|
||||
#gpu color
|
||||
gp=($(python3 -c "p=($gpu/100); print(int(p*255), int((1-p)*255))"))
|
||||
gp=($(python3 -c "p=min(max(($gpu/100), 0), 1); print(int(p*255), int((1-p)*255))"))
|
||||
|
||||
#setgpu color
|
||||
gpucolor="${gp[0]},${gp[1]},0"
|
||||
|
|
Loading…
Reference in New Issue