nwg-piotr / nwg-wrapper

Wrapper to display a script output or a text file content on the desktop in sway or other wlroots-based compositors
MIT License
139 stars 8 forks source link

Document power usage #31

Closed rrueger closed 1 year ago

rrueger commented 1 year ago

Thank you for having written this great piece of software!

I use nwg-wrapper to display the time on my desktop (and nothing else). The script run is

time=$(date +'%H:%M')
day=$(date +'%A, %e %b')

cat<<EOF
<span size="60000" foreground="black" weight="light"> $time </span>
<span size="35000" foreground="black" weight="light">  $day </span>
EOF

To appear nicely synchronous, I set the refresh time to 100 i.e. 10 refreshes per second.

I only realised a long time afterwards, that this is costs a lot of energy: 2 Watts (perhaps over proportionally so?)

My laptop's base energy consumption is around 7 Watts. Light usage uses around 10 Watts.

With nwg-wrapper -r 100 power consumption was around 2 Watts higher. nwg-wrapper -r 5000 costs only 0.1 Watts.

It seems very high, that 10fps refreshes costs, ~30% of the energy to run the rest of the OS(?)

My particular problem is solved, by setting a lower refresh rate. However, perhaps this is something that should be documented?

nwg-piotr commented 1 year ago

Hi,

Creating GTK widgets is power-hungry, so doing it ten times a second is a bit of overkill. Dunno if it needs documentation.

rrueger commented 1 year ago

Fair enough. Thought it might be useful to throw in a sentence. I guess this issue counts as documentation for anyone else who notices this.

Thank you!