dsda-doom
dsda-doom copied to clipboard
Change data directory if running as Flatpak
This is part of an attempt I'm making to create a Flatpak port of DSDA-Doom to make it easier to install for more Linux users (see #460). This change has the application check if it is running under Flatpak by checking if the /.flatpak-info
file exists, and if it does, it changes where the .dsda-doom
folder is stored to be within the application's personal filesystem. Without this change, the application would need access to all files in the user's home folder.
I think we probably want something more general here and should respect the xdg_data_home standard more broadly (there's another PR also moving in that direction). Maybe something like this:
- Check if old $HOME/.dsda-doom exists -> if it does, then use it (i.e., be backwards compatible with existing installations)
- Check if $XDG_DATA_HOME exists -> if it does, use $XDG_DATA_HOME/dsda-doom (I assume no preceding
.
is used in this case) - If it doesn't exist, use $HOME/.dsda-doom as before
What do you think?
Sounds good -- if $XDG_DATA_HOME isn't defined, should $HOME/.local/share be used as a fallback as per the standard, or should $HOME/.dsda-doom be created in that case?
Oh sure, you can go with the .local/share one for consistency