Closed keianrao closed 4 years ago
The way I'm using it right now - as part of a GUI launch script
#!/bin/sh
export ASCII_PATROL_CONFIG_PATH="$HOME/.config/asciipat"
export ASCII_PATROL_RECORD_PATH="$ASCII_PATROL_CONFIG_PATH"
export ASCII_PATROL_SHOT_PATH="$ASCII_PATROL_CONFIG_PATH"
konsole \
--profile "Gaming" \
--hide-tabbar --hide-menubar \
-e "sh -c '/usr/local/bin/asciipat-dir/asciipat "$@"'"
Hey, thanks for adding config vars! I like it, could you please add some usage help to README.md? I'd be happy to pull it then :)
Nothing wrong with configurable save and config, but it's standard practice to put them in ~/.whatever or ~/.config/whatever.
If users want the files stored elsewhere, a symlink can be created with "ln -s" command.
Hello everyone,
I sincerely apologise for the late reply. I had to think things through a bit as well... But I still prefer that @msokalski decide what is best, as it's their game..
~/.config/
is actually the default directory for 'XDG_CONFIG_HOME' in the XDG Base Directory Specification. It sounds super bureaucratic but a lot of Linux applications follow it, including games. If ASCII Patrol tags along, then while asciipat.cfg
definitely should go in $XDG_CONFIG_HOME/asciipat/asciipat.cfg
, I think asciipat.rec
and the shot files should go in $XDG_DATA_HOME/asciipat/asciipat.rec
, etc. instead.
Above are two more commits following this behaviour (with really wacky code).
Following those directories should be optional - XDG_CONFIG_HOME and XDG_DATA_HOME are not set by default for the user, so without explicitly setting them, the game should continue to do things as it currently does. But there is a chance that their operating system sets it for them, which doesn't exist if we use custom variables. So maybe custom variables would be better after all.
I'm really slow but I'm working on it now, for both using the XDG environment variables and using custom ones.
This pull request has 4 commits which is a lot - so I think I'm going to close this pull request, create two new branches that changes the code cleanly in one commit, and then make a pull request for whichever msokalski wants.
Thank you for your patience with me so far.
Hello again,
For the XDG case, I have to make a directory 'asciipat' using mkdir(2)
, but I have no idea where and how to put this. So I think I will close this pull request after all, and redo the custom environment variable path.
Hi,
This pull request is more of a suggestion and/or discussion thing, rather than an actual pull request.
In the attached commits are code I've written for myself to have ASCII Patrol's config, high score record, etc. saved to a directory of my choice, rather than my home directory. They're UNIX-specific (viz. I only edited spec_nix.cpp).
I personally would really like if there was an official way to do this..! It's like one thorn in an otherwise perfect game.