aristocratos / bpytop

Linux/OSX/FreeBSD resource monitor
Apache License 2.0
10.1k stars 396 forks source link

[REQUEST] Add gradient to CPU graph #117

Open RedBearAK opened 4 years ago

RedBearAK commented 4 years ago

There is a gradient on the process display, which is very nice, and a surprising feature of a terminal application. If possible, could a similar gradient be applied horizontally to the CPU graph?

The idea is to make the older CPU activity "fade away" into the past as it moves off to the left side of the CPU box. The visual implication being that the more important CPU activity displayed at full brightness is what's happening "right now", so that's what the user would want to focus on more.

Plus I just think it might look really neat.

One motivation for asking for this is because it might make the CPU graph blend much more gracefully into the uptime display overlay.

aristocratos commented 4 years ago

@RedBearAK That would be cool but isn't possible without dramatically increasing the cpu usage and memory usage for the graph.

The way the graphs work now they have one color coded for each line height wise, to get your wanted effect there would need to be a color value coded for each character in the graph, increasing the size by 12-15 characters for each character in the graph and then to update the graph it would either need regex (which is expensive) to clean up the last color codes and symbols on the left side or need to be recreated from scratch (also expensive), at every update. Plus the added calculations for creating a RGB value from two different arrays (probably not that expensive since it could be done once for current graph dimensions).

RedBearAK commented 4 years ago

@aristocratos

That would be cool but isn't possible without dramatically increasing the cpu usage and memory usage for the graph.

Ah, that is unfortunately exactly what I was afraid you would say. So it will only work practically on the process box and similar text lists that aren't updating too frequently.

Well, it's a very nice effect on the process graph and sounds like it was hard work putting it together.

I really enjoyed noticing that the highlighting/shading would follow the selection as you scroll up and down on the process list. That kind of blew my mind. I finally noticed that back when I was looking at how to move the process count element. Had to scroll through the whole list to make sure the modification wouldn't cause problems.

Guess you can close this now if you don't want to keep it on the back burner and think about whether there might be a more efficient way to implement it. I think people would go nuts if you could actually get it working.

I hear rust is much faster than python... *wink*

aristocratos commented 4 years ago

We can keep it open for now and I'll play around with it when I've got time, but it's likely it won't be implemented.

I hear rust is much faster than python... wink

Yeah, that is likely the next evolution of this project, but not in the near future, need a couple of weeks of spare time to sit down and learn rust first :)

RedBearAK commented 4 years ago

We can keep it open for now and I'll play around with it when I've got time, but it's likely it won't be implemented.

Alright then, I won't close it for now.

Yeah, that is likely the next evolution of this project, but not in the near future, need a couple of weeks of spare time to sit down and learn rust first :)

I LOLed at this but I'm not even sure you're joking. LOL.

Best of luck in any case.

aristocratos commented 4 years ago

@RedBearAK

I LOLed at this but I'm not even sure you're joking. LOL.

I'm not gonna be happy until it's in it's final form, assemblertop and it's more efficient then a bootstrapping bootloader. :)

But seriously though, I'm planning on getting into rust, and porting this is very likely the best way to learn.

RedBearAK commented 4 years ago

@aristocratos

Don't forget the UEFI bootloader stub so I can install it in my EFI partition and boot directly into it, bypassing all this "operating system" nonsense.

Just don't call it "asstop".

But seriously though, I'm planning on getting into rust, and porting this is very likely the best way to learn.

I cannot argue with that. It would be a great starter project since you're already so familiar with the code, what it's "supposed" to do, and you've already successfully ported it all from another scripting language before this.

Have fun.