Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.4k stars 696 forks source link

Add support of nvidia graphics using nvidia-smi #3242

Closed voidThread closed 4 months ago

voidThread commented 4 months ago

Hi! I've introduced the new module which pulls data from the external 'nvidia-smi' program. The module runs 'nvidia-smi' as a forked process and saves GPU monitor data into the exchange file. If not specified in the configuration file, the file is created in the system's temporary directory. You can define your own exchange file, but you must ensure that it exists and has proper privileges set. Since this is my first contribution here, I'm eager to receive feedback on any areas that could be improved.

haug1 commented 4 months ago

I'm not one to comment on this really and I can't test it unfortunately, but from a quick skim of the code and the assumption that you've tested it too work on your machine; great work, looks like you've done a really good job with this.

I can give you a heads-up about the man pages, it's probably going to get requested that you add some documentation for how to use this if it is to get merged.

Some kind of conditional include in the build step, like what's done with the cava module (if you search "HAVE_LIBCAVA" and follow the trail, you can try to do something similar) would also probably be nice. I'm not sure what's possible, should probably have lead with I'm pretty bad at C++.

voidThread commented 4 months ago

Thanks, @haug1 ! I've been using this for a few days without any problems. Also, I've added what you proposed.

haug1 commented 4 months ago

I didn't think of this yesterday, sorry. But this might be simply and more correctly achieved for users with a custom module instead so to manage the scope of the project and therefore not interesting to merge. Again, I'm not really one to comment on this. Just thinking out loud. :)

Alexays commented 4 months ago

Yup, like @haug1 said, theses specific modules, as pretty simple should be done in a custom module :)

haug1 commented 4 months ago

Sorry to have added work on you with my first comment @voidThread, that was not my intention. Just wanted to give some feedback, but didn't think it through until later.

(Also, sorry to that other guy I accidentally tagged.)