-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XDG Base Directory Spec is not followed #12508
Comments
I don't have a strong opinion about this, I sense it falls under the opinated onboarding that
... this isn't a valid point, either |
I think you misunderstand. It's not that it's difficult to see dot folders. Because yes you can reveal them fairly trivially. It's that the sheer abundance in a directory as central as home is often considered undesirable. A typical desktop user will end up with many dozens of them. I count 38 on my relatively fresh install of a couple months now, and my partner has ~160. For those who daily drive linux it's a disorganized mess in the most central of folders. The annoyance is common enough that major DEs have features to permanently hide specified dotfiles in their file navigators - even when you enable the "show hidden files" toggle. Both Nautilus and Dolphin (Gnome and KDE) allow you to use a And outside just the GUI there's several popular tools like boxxy and xdg-ninja. This isn't some fringe opinion either. We can defer to the very people who are responsible for architecting these conventions: https://web.archive.org/web/20180827160401/https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp In fairness this isn't the most pressing need. People aren't about to abandon ship over a few dotfiles. I don't expect this to be a high priority. But this is the general direction linux directory management has been headed over the last ~20 years. |
Checking my two physical and one virtual Fedora 40 systems (two are serial in-place upgrades, one was installed from scratch as F39 and then upgraded in-place), the two oldest systems define only XDG_DATA_DIRS, and the newest one also has XDG_CONFIG_DIRS. None of the 3 define any of the XDG_*_HOME variables, which is what would actually be useful. So given that we'd have to fall back to just hardcoding ~/.local/{share/config/state} on a significant population of user machines anyway I think we can just add that to the default search path for mame.ini and people can choose to use it or not. |
That is expected. As I'd mentioned previously:
As in, only if it's unset then fall back to the default If a user expects their config files to be under The ideal is to check for preexisting data in |
My two cents: the XDG directory specs are false starts toward a goal nobody ever really implemented. The purpose of The purpose was never about making home directories "less messy" (you can simply stop using Given that it would cause confusion and MAME is probably not appropriate for a workspace environment anyway, I honestly don't see value in even attempting this. Sticking to |
It's good that Mame has enough config options to do this yourself. Setting #!/usr/bin/sh
/usr/lib/mame/mame -inipath "${XDG_CONFIG_HOME}/mame/ini" "$@" Add a [Desktop Entry]
Type=Application
Name=MAME™ Arcade Emulator
GenericName=Arcade Emulator
Comment=Play vintage arcade games using the MAME™ emulator
Icon=mame
Exec=sh -c ~/.local/bin/mame
Terminal=false
Categories=Game;Emulator;
Keywords=Game;Emulator;Arcade; Now an example # ...
#
# CORE SEARCH PATH OPTIONS
#
homepath $XDG_DATA_HOME/mame/lua
rompath $XDG_DATA_HOME/mame/rom
hashpath /usr/lib/mame/hash
samplepath $XDG_DATA_HOME/mame/samples
artpath /usr/lib/mame/artwork
ctrlrpath /usr/lib/mame/ctrlr
inipath $XDG_CONFIG_HOME/mame/ini
fontpath /usr/lib/mame/font
cheatpath /usr/lib/mame/cheat
crosshairpath $XDG_DATA_HOME/mame/crsshair
pluginspath /usr/lib/mame/plugins
languagepath /usr/lib/mame/language
swpath $XDG_DATA_HOME/mame/software
#
# CORE OUTPUT DIRECTORY OPTIONS
#
cfg_directory $XDG_CONFIG_HOME/mame/cfg
nvram_directory $XDG_DATA_HOME/mame/nvram
input_directory $XDG_DATA_HOME/mame/inp
state_directory $XDG_DATA_HOME/mame/sta
snapshot_directory $XDG_DATA_HOME/mame/snap
diff_directory $XDG_DATA_HOME/mame/diff
comment_directory $XDG_DATA_HOME/mame/comments
# ... I didn't find any examples online of people getting Mame to follow XDG, so I defined the directories I thought were appropriate above. Adjust to your liking. |
MAME version
0.266
System information
Any Linux distro
INI configuration details
No response
Emulated system/software
No response
Incorrect behaviour
Mame does not follow the freedesktop $XDG spec on linux environments. Instead, it uses its own
~/.mame
directory.Expected behaviour
For future installs default to the XDG spec for config/data/state/etc as defined here.
Steps to reproduce
No response
Additional details
While the ~/.mame directory technically works, and its location is configurable, defaulting to a dot folder in the home directory has fallen out of "best practice" in favor of compartmentalized directories managed by the OS, much like other operating systems. As in, Windows'
%AppData%
et al. For the more Windows aligned you can see a cross-OS comparison documented by the GO implementation here. You can also see a sample of what other software has adopted the standard here.From a user's perspective:
The previously linked XDG spec here should have all the relevant details. The categories are cache, configuration, data, state, and runtime files. Mame's
.mame
contents are largely config and data. As an example, if something like$XDG_CONFIG_HOME
isn't set (most distros don't) the default is$HOME/.config
.There's arguably no pressing need to migrate users right away. Existing installations are fine as-is. The idea is to check if there's an existing
$HOME.mame
, and if it's not present then fall back to the new XDG defaults, with the idea you flip that around after 20 years or so. And for safety you can add an override variable. I believe that aligns with what Mozilla is planning.The text was updated successfully, but these errors were encountered: