nwg-piotr / nwg-drawer

Application drawer for wlroots-based Wayland compositors
MIT License
233 stars 25 forks source link

Respect XDG_DATA_DIRS #115

Closed Serpentian closed 6 months ago

Serpentian commented 6 months ago

Currently path to the power icons is hardcoded to /usr/share/.... However, XDG_DATA_DIRS doesn't always include this directory on read-only OSs, like NixOS. There this data is stored inside $HOME/.nix-profile/share/

https://github.com/nwg-piotr/nwg-drawer/blob/71ce3b5d759a4d00e835525f4716317a1bccdfad/main.go#L589

$XDG_DATA_DIRS should be respected, when we search for the power icons. The same thing applies to the desktop-entries.


The possible solution would be to add $HOME/.nix-profile/share to the xdgDataDirs. Or we can get env variable XDG_DATA_DIRS directly, without hardcoding it (it seems better).

https://github.com/nwg-piotr/nwg-drawer/blob/71ce3b5d759a4d00e835525f4716317a1bccdfad/tools.go#L243

nwg-piotr commented 6 months ago

I don't care much about Nix, but yes, it could be done. If it comes to .desktop dirs, XDG_DATA_DIRS are already respected.