Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Can I change the .dwarffortress directory in Linux?  (Read 1746 times)

agregate

  • Bay Watcher
    • View Profile
Can I change the .dwarffortress directory in Linux?
« on: September 25, 2020, 12:25:42 pm »

Hi all!
Just want to ask if the data directory that gets stored in the users home folder in linux (.dwarffortress) can be moved to another directory? I like my home folder clean and actually have a Games subdirectory where I store my configs and data for all other games.

Thank you!
Logged

Clément

  • Bay Watcher
    • View Profile
Re: Can I change the .dwarffortress directory in Linux?
« Reply #1 on: September 25, 2020, 04:28:35 pm »

Dwarf Fortress does not create a .dwarffortress directory. How did you install it? It must be an issue with the package you used.
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: Can I change the .dwarffortress directory in Linux?
« Reply #2 on: September 25, 2020, 05:03:20 pm »

And which Linux distro are you using? If it's Arch based you should be able to just edit the dwarffortess script (which gets installed to /usr/bin/).
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

Clément

  • Bay Watcher
    • View Profile
Re: Can I change the .dwarffortress directory in Linux?
« Reply #3 on: September 25, 2020, 05:30:42 pm »

Editing a script installed by a package manager is a bad idea. The changes will get overwritten by the next update. You should ask the maintainer to fix it and follow the XDG Base Directory Specification instead.
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: Can I change the .dwarffortress directory in Linux?
« Reply #4 on: September 25, 2020, 06:37:20 pm »

Well, Arch's pacman checks for file modifications and will install the new versions as file.pacnew rather than overwrite.

One could also download the package files and build their own package. And then create a pull request for the fix rather than expect the maintainer to do it.

Another option is to just install DF manually in the Games folder. This has the benefit of letting you choose when to update in the case of save game, utility, or mod incompatablities.
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

agregate

  • Bay Watcher
    • View Profile
Re: Can I change the .dwarffortress directory in Linux?
« Reply #5 on: September 26, 2020, 09:26:40 am »

I am indeed running Arch (and will be trying this on a Gentoo soon to see if its Arch-only).

I don't see how it is related to the installation because the folder appears when the game is opened for the first time. If I delete the folder and open DF again it will be recreated hence why I'm thinking it's hardcoded?
I have an XDG variable set which all my other apps abide by but the game seems to ignore it.

Edit:
Looking at the arch script that @Ziusudra linked to, perhaps the /opt symbolic link is being recreated? Maybe I should try relinking it to a custom directory...
Logged

Clément

  • Bay Watcher
    • View Profile
Re: Can I change the .dwarffortress directory in Linux?
« Reply #6 on: September 26, 2020, 10:13:04 am »

I don't see how it is related to the installation because the folder appears when the game is opened for the first time. If I delete the folder and open DF again it will be recreated hence why I'm thinking it's hardcoded?

Because the behavior you are describing is not part of the game as distributed by bay12games, but something added by the arch packager. As a general rule, don't report bug you have with a package directly upstream, unless you reproduced the bug with the upstream version. Packagers often add patches to software and bugs may be created by those patches but upstream won't know about it. And if you are asking for help on forum, don't forget to specify which version you downloaded.

Looking at the arch script that @Ziusudra linked to, perhaps the /opt symbolic link is being recreated? Maybe I should try relinking it to a custom directory...

Replace all occurrences of $HOME/.$pkgname by whatever path you prefer (${XDG_DATA_HOME:-$HOME/.local/share}/$pkgname if you want to use XDG_DATA_HOME).
« Last Edit: September 26, 2020, 10:15:59 am by Clément »
Logged

agregate

  • Bay Watcher
    • View Profile
Re: Can I change the .dwarffortress directory in Linux?
« Reply #7 on: September 28, 2020, 07:04:23 am »

I don't see how it is related to the installation because the folder appears when the game is opened for the first time. If I delete the folder and open DF again it will be recreated hence why I'm thinking it's hardcoded?

Because the behavior you are describing is not part of the game as distributed by bay12games, but something added by the arch packager. As a general rule, don't report bug you have with a package directly upstream, unless you reproduced the bug with the upstream version. Packagers often add patches to software and bugs may be created by those patches but upstream won't know about it. And if you are asking for help on forum, don't forget to specify which version you downloaded.

Looking at the arch script that @Ziusudra linked to, perhaps the /opt symbolic link is being recreated? Maybe I should try relinking it to a custom directory...

Replace all occurrences of $HOME/.$pkgname by whatever path you prefer (${XDG_DATA_HOME:-$HOME/.local/share}/$pkgname if you want to use XDG_DATA_HOME).

Thank you for the explanation. What you wrote at the end worked perfectly! Thank you all!
Logged