Skip to content
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

support xdg standard directory structure #194

Closed
JotaRandom opened this issue May 2, 2017 · 1 comment
Closed

support xdg standard directory structure #194

JotaRandom opened this issue May 2, 2017 · 1 comment

Comments

@JotaRandom
Copy link
Contributor

JotaRandom commented May 2, 2017

Actually the configuration files are placed on $HOME/.snes9x for store user specific
It will be better if snes9x start using the xdg- standard specification that now is used for most programs like gnome, kde, xfce, pacma package manager, wayland, etc.

the file in linux in question is the cpp file gtk/src/gtk_config.cpp with contain in get_config_dir a hardcoded path to fix this a simple change in that file is need.

a bash example is of how showld look is:

XDG_SNES9X_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/snes9x"
if [[ $SNES9X_XML = "$confdir/snes9x.xml" && -r "$XDG_SNES9X_DIR/snes9x.xml" ]]
	source_safe "$XDG_SNES9X_DIR/snes9x.xml"
elif [[ $SNES9X_XML = "$confdir/snes9x.xml" && -r "$HOME/.snes9x/snes9x.xml" ]]; then
	source_safe "$HOME/.snes9x/snes9x.xml"
 fi

than an example in bash that check for snes9x.xml fire in the XDG_USER_DIR and fallback to the old location if not found and again fallback to the sysconfdir if not found too.

this will make snes9x go in line with standard specification used and will not affect old userd if the fallback is used

this is the entire paper abiut the xdg structure https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

@bearoso
Copy link
Collaborator

bearoso commented May 6, 2017

Should be handled now. Looks for the directory, not the config file.

@bearoso bearoso closed this as completed May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants