mathoudebine / turing-smart-screen-python

Unofficial Python system monitor and library for small IPS USB-C displays like Turing Smart Screen or XuanFang
GNU General Public License v3.0
1.09k stars 182 forks source link

Advanced radials #500

Open caerffili opened 5 months ago

caerffili commented 5 months ago

I want the ability to create intersecting radials that share the same screen real estate, for example the CPU usage forms the left half and GPU usage forms the right half. Best described on the screen shot-

preview

As the radials overlap they would ordinarily overwrite and corrupt each other, unless I've missed something of course!!!!

I've implemented two new elements in the yaml for radials-

CUSTOM_BBOX: [0, 0, 80, 160] TEXT_OFFSET: [-30, 0]

Custom BBox defines a boundary box which overrides the standard boundary box and effectively clips the radial image.

Text offset allows moving the text inside the boundary relative to the centre of the radial.

UPDATE - Added the ability to draw a background colour on the radial to highlight the full scale and the option to round off the end of the radial bars (draws an ellipse). New yaml to support this-

BAR_BACKGROUND_COLOR: 0, 50, 0 DRAW_BAR_BACKGROUND: True BAR_DECORATION: Ellipse

caerffili commented 5 months ago

I think I found a bug fix in stats.py as well-

image

mathoudebine commented 5 months ago

Thanks for contributing! I will try to review it and integrate it soon 🙂