You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been doing a bit of work and I managed to create an Arch User Repository package for Open Hexagon: open-hexagon-git. The end goal here is to allow Linux users to install the game with just one command (ex. yay open-hexagon-git) and it will simply get installed in the system-wide directory /usr/lib/open-hexagon, just like all other Linux software.
The problem is, /usr/lib/ is owned by root and is typically "read-only" for regular users. This means that, unless you run Open Hexagon with root privileges, it won't be able to save any data and will actually crash. I've done some workarounds for this (you can look at the package's PKGBUILD), but it's a very ugly solution.
The way pretty much every other Linux program solves this is by saving all data somewhere in the user's home folder. Configuration data is saved to $XDG_CONFIG_HOME (or ~/.config) and state data is saved to $XDG_DATA_HOME (or ~/.local/share)
I suggest that you do the same. Maybe first try to read files from the installation directory, for backwards compatibility, but for new users, all save files should follow the XDG standard. Configs, including custom Packs, should be in the config dir, and things like logs and replays could be in the data dir.
The text was updated successfully, but these errors were encountered:
gardenappl
changed the title
Linux build should implement XDG Base Directory (don't save files in installation folder)
Linux version implement XDG Base Directory (don't save files in installation folder)
Nov 9, 2020
gardenappl
changed the title
Linux version implement XDG Base Directory (don't save files in installation folder)
Linux version should implement XDG Base Directory (don't save files in installation folder)
Nov 9, 2020
I've been doing a bit of work and I managed to create an Arch User Repository package for Open Hexagon: open-hexagon-git. The end goal here is to allow Linux users to install the game with just one command (ex.
yay open-hexagon-git
) and it will simply get installed in the system-wide directory/usr/lib/open-hexagon
, just like all other Linux software.The problem is,
/usr/lib/
is owned by root and is typically "read-only" for regular users. This means that, unless you run Open Hexagon with root privileges, it won't be able to save any data and will actually crash. I've done some workarounds for this (you can look at the package's PKGBUILD), but it's a very ugly solution.The way pretty much every other Linux program solves this is by saving all data somewhere in the user's home folder. Configuration data is saved to $XDG_CONFIG_HOME (or
~/.config
) and state data is saved to $XDG_DATA_HOME (or~/.local/share
)I suggest that you do the same. Maybe first try to read files from the installation directory, for backwards compatibility, but for new users, all save files should follow the XDG standard. Configs, including custom Packs, should be in the config dir, and things like logs and replays could be in the data dir.
I've been looking around and it looks like @flibitijibibo had already provided a solution a while ago (https://gist.github.com/flibitijibibo/5139524)
The text was updated successfully, but these errors were encountered: