fflewddur / tophat

View CPU, memory, disk, and network activity in the GNOME top bar.
https://extensions.gnome.org/extension/5219/tophat/
GNU General Public License v3.0
347 stars 26 forks source link

Avoid displaying an used swap of NaN% #55

Closed flozz closed 1 year ago

flozz commented 1 year ago

Hello,

I do not have any swap (32 GB of RAM is sufficient for me), and TopHat displays a swap usage of NaN%:

Capture d’écran du 2022-12-28 10-15-51

This PR contains a simple fix to avoid this behavior.

A better solution would be to hide swap statistics if there is no swap (I can try to implement it if you think it is a better solution).

fflewddur commented 1 year ago

Thanks, good catch! I agree that the better solution is to hide that section entirely when no swap partition is available, but this is an improvement over the current behavior.