scorpion-26 / gBar

Blazingly fast status bar written with GTK
MIT License
459 stars 17 forks source link

fix: replace hard-coded paths with envs #67

Closed Mikilio closed 6 months ago

Mikilio commented 8 months ago

According to XDG specifications paths like /usr/share etc. are usually in XDG_DATA_DIRS. Since this variable may be set differently for other linux distributions we prefer those environment variables to hard-coded paths. As such hard-coded paths have been removed

This solves issue #66

Mikilio commented 8 months ago

I will correct those. It was a missunderstanding on my part that some systems don't support this spec by default. I was under the impression that XDG_DATA_DIRS being set was a valid assumption.

Mikilio commented 8 months ago

In my correction I opted to get rid of the CSSDir struct because it overcomplicated the loop through the different locations. I added the /usr/local/share and /usr/share to locations by adding two simple lines.

Let me know if you prefer me making use of Utils instead of stringstreams.

Sorry for my messy first attempt and thanks for the detailed review

Mikilio commented 8 months ago

I applied the changes in the first push and ran the formatter in the second one. Thank for the guidance.

Mikilio commented 8 months ago

Thank for allowing me to have my first PR in C++ 😄 (I hope it gets merged now)

Mikilio commented 8 months ago

I made this commit in a hurry because I was about to leave for a trip. I will correct this next week before Friday.

scorpion-26 commented 6 months ago

Decided to resolve the last issue. Thanks again for the PR!