actuallymentor / battery

CLI/GUI for managing the battery charging status for Apple silicon (M1, M32, M3) Macs
MIT License
3.89k stars 166 forks source link

Support putting config dir in $XDG_CONFIG_HOME #308

Open twio142 opened 1 month ago

twio142 commented 1 month ago

Regarding #208

I just patched where ever $HOME/.battery is found in the code.

Basically it checks whether the env var XDG_CONFIG_HOME is set. If so, set the config dir to $XDG_CONFIG_HOME/battery, otherwise fallback to $HOME/.battery.

Tell me if I'm missing something :)

tim25651 commented 4 days ago
  1. Wouldn't you rather set the default location to $HOME/.config as stated in the specs at https://specifications.freedesktop.org/basedir-spec/latest/?
  2. XDG_CONFIG_HOME should be ignored in my opinion, if the script is used as setup for another user.