Please, consider moving the DOSBox-X config file to a different place than ~/dosbox-x.conf or renaming it to ~/.dosbox-x.conf (making it a hidden file). For example, regular DOSBox has its config file inside a ~/.dosbox directory. I like to keep my home directory clean and it seems that there is no easy way to achieve this while using DOSBox-X (from Flathub). It is probably possible to workaround this by using a custom desktop launcher file that adds switch pointing to a different config file, but it is not a good solution, at least in my opinion.
Also, having the config file directly in a home directory prevents Flatpak from being able to be properly sandboxed, because Flatpak does not support persistent files, only directories.
The default dosbox-x config file is in the XDG_CONFIG_HOME location, or ~/.config/dosbox-x/dosbox-x-version.conf
This is flatpak compliant.
Then, there is some problem with the DOSBox-X Flatpak, because the default config file seems to be created as ~/dosbox-x.conf.
I don't understand why it would be ~/dosbox-x.conf. It used to be ~/.dosbox/dosbox-x-version.conf then it got moved to ~/.config/dosbox-x/dosbox-x-version.conf and recently XDG_CONFIG_HOME got checked, and if set (such as for flatpak), will be used.
In any case, I have created a new flatpak version today, but does not yet seem to be published on the webpage. No idea how long that takes.
https://flathub.org/builds/#/builders/32/builds/31521
I just tried the latest build (it is published on Flathub now). The config file does not seem to be created automatically at all, but when opening the Configuration Tool menu and clicking "Save...", it is placed directly into the home directory:
ls -la ~/dosbox-x.conf
-rw-r--r--. 1 asciiwolf asciiwolf 46633 1.聽lis 19.04 /home/asciiwolf/dosbox-x.conf
When I try to enter a custom config file name (.dosbox-x.conf), it gets saved, but DOSBox-X does not load this file on next start.
config is never automatically generated. Please run config -wcd -all
Thanks, running this command inside DOSBox-X saved the config to a correct XDG location and the "Save..." dialog in Configuration Tool menu now also saves the config file to a correct location.
Would it be possible to update the "Save..." dialog to offer correct XDG location without requiring users to manually type the config -wcd -all command first? :-)
I have added a note to https://github.com/flathub/com.dosbox_x.DOSBox-X about the config file not existing by default and how to create one. However I don't think most people will ever check the page.
Yeah, not many people actually browse the Git repo. You can add the same note to an AppStream metadata file. ;-)
I think you can also mention that config -wcd should be fine for many cases, while -all will write all options for those who need them. If you just want the modified options, then run it with -mod.
the new metadata, including screenshots is now also finally showing https://flathub.org/apps/details/com.dosbox_x.DOSBox-X
@rderooy Great! It is now linked from the website too.
@rderooy By the way, can you update the screenshot (at least the first one which shows up by default) in the DOSBox-X Flathub page to show 0.83.7 instead of 0.83.6? By doing this other users will hopefully better know they will download the 0.83.7 version. Thanks!
@Wengier the screenshot is this one: https://github.com/joncampbell123/dosbox-x/blob/master/contrib/linux/dosbox-x_startup.png
So updating that would show the new version number. Although I don't know if flathub does any caching of the images, so it could be that simply replacing the image has no effect until a new build is done.
I did not think just showing a (slightly) out of date version number on the screenshot would really matter. If you think it does, than a new screenshot needs to be made every month.
In any case, I anticipate my time to be more scarce for the near future, so don't expect any quick turn around.
@rderooy I see. As we are moving forward, maybe it can be updated for the next version then (by anyone who has the time to do so).
So, any chance that the information about config -wcd could be added to DOSBox-X AppStream metadata? :-)
I'm thinking that perhaps when dosbox-x is started, and no config file is specified or found that it should generate one. But I'm not fully sure.
I cannot have flatpak auto-install one in XDG_CONFIG_HOME, since I don't have access to that when generating the package.
I had a quick look as to the cause of your original issue, namely that saving from the GUI causes the file to get created in your home directory and quickly found it.
In src/gui/sdl_gui.cpp on line 1324 it simply saves to the "current directory". Either the code here needs to take into account the save paths for Linux and macOS which could be done by taking code from how the config command creates a new file. Or probably better, a function should be created that both methods of creating a config file can use.
I found another strange one in src/gui/sdlmain.cpp on line 1057 where /.dosboxrc is defined as the default config file for Linux.
@rderooy I think DEFAULT_CONFIG_FILE is defined in src/gui/sdlmain.cpp but is never actually used there. The definition in src/misc/cross.cpp is used though.
On the other hand, I think the config save dialog in the Configuration Tool can be enhanced.
@rderooy The new code in src/gui/sdl_gui.cpp of my pull request will hopefully give the option to save to primary or user config files, not just the hard-coded dosbox-x.conf file in the current directory.
Is there any pull request/patch I could test? :-)
The code change from @Wengier has been merged, so if you compile the latest code you should have it. Alternatively you can wait until the end of the month for the monthly release, when I spin a new flatpak.
Was this issue fixed in latest DOSBox-X release? :-)
The latest release, such as the flatpak has the change from @Wengier mentioned above.