fredldotme / prime-indicator

PRIME Indicator - indicator applet for NVIDIA Optimus laptops
GNU General Public License v2.0
45 stars 31 forks source link

Enable complete NVIDIA GPU power management when using the Intel GPU #25

Closed andrebrait closed 7 years ago

andrebrait commented 7 years ago

Hi there. I think this is the cherry at the top of the cake that's been missing for a while.

While this switcher is nice and it provided a quick and easy way to tell which GPU was being used, NVIDIA PRIME was still incomplete as it always left the NVIDIA GPU on regardless of it being used for rendering or not. Since it was still a problem when it came to power consumption, I started writing code to enable power management through bbswitch. I wrote it all during the evening and tested it a lot for a few hours. I haven't found any issues other than the dark version of my icons appearing a bit different than the light versions, but that's a tiny detail. The power management stuff is the real star of this pull request.

I don't know if you guys are gonna find my code good enough, I don't really code much in Python, but any and every criticism is welcome here.

Ps.: I just extended my notebook's battery life from 4h to almost 7h with this modification.