0ry0n / Resource_Monitor

Resource_Monitor is a GNOME Shell extension that Monitor the use of system resources like cpu, ram, disk, network and display them in GNOME Shell top bar.
GNU General Public License v3.0
143 stars 20 forks source link

Attempt to add Bps speed option #28

Closed Digitalone1 closed 3 years ago

Digitalone1 commented 3 years ago

Hello. I tried to make an attempt to add Bps speed option since the monitor shows network speed in Byte/s unit only. Fixes #27

I made this with my Javascript knowledge. Didn't test it because I don't know how to do it in Gnome environment. Anyway if it's not working I think it could be a good start to you to fix little things in very short time, most of the work could have be done.

bpsspeed option has been added as a Boolean. It's false as default, so the eth/wlan refresh methods pick byte values and show them as previously done.

If it is set to true, the speed values are multiplied by 8 (factor variable, default to 1), so they are converted to bit.

Then, discovering multiple unit (kilo, mega, giga), a unit variable is used to divide: 1024 as default, 1000 for bpsspeed as true.

According to bpsspeed value, an uppercase/lowercase unit letter is showed.

Hope this works.

Let me know if something has been done wrong. Thanks.

Checklist

0ry0n commented 3 years ago

Hello, thanks for your cooperation. Your code is fine but i refuse the pull because i had already added the functionality in the local repository.

Digitalone1 commented 3 years ago

Where did you add it? I don't see the option in the extension. I installed the latest release.

Digitalone1 commented 3 years ago

There's no speed unit option. I installed the latest release.

Schermata del 2021-04-26 16-25-05

0ry0n commented 3 years ago

Temporarily, you can use the version in the gnome-40.0 branch.

https://github.com/0ry0n/Resource_Monitor/tree/gnome-40.0#cloning-the-branch

Digitalone1 commented 3 years ago

Ok, you didn't push it, now I understood. Thank you.