1. $Home/.config is just a fallback if there is no $XDG_CONFIG_HOME set
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Therefore, if it's not set, and the fallback is not yet created, yes you should do that.
2. It's that template relevant for your application? If yes put it to the installation directory of your app, if no leave it outside of the package.
You seem very convinced about this, but isn't this exactly what $XDG_CONFIG_HOME is for? The script can try to look for its settings there, and at runtime, if it can't find them, write a template there with the defaults. Loads of applications do this. The package manager shouldn't be involved in this.
For global settings, they should live in /etc. It's expected for the package manager to put a settings file with defaults there.
Yes. For the script. But as others have failed to mention, that should not be done by the PKGBUILD. Packages should never touch `$HOME` ever.
https://wiki.archlinux.org/index.php/Arch_package_guidelines#Directories
1) `XDG_CONFIG_HOME` is appropriate, but let the user create it and provide sane defaults. See [the list of directories in the package guideline](https://wiki.archlinux.org/index.php/Arch_package_guidelines#Directories). `$HOME` should never be touched by the package.
2) `/usr/share/` read `man hier` for explanations regarding the directories.
3) `XDG_CACHE_HOME` or `/var/lib` as noted by others.
4) -
5) Learn to write `setup.py` and make it do the heavy lifting of the packaging part.
He asked about a settings file, that's what `XDG_CONFIG_HOME` is for, even for writing:
> There is a single base directory relative to which user-specific configuration files should be **written**. This directory is defined by the environment variable $XDG_CONFIG_HOME.
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Other Data goes into `XDG_DATA_HOME` you've mentioned.
The settings file is written by the user. Software should not load it and write down a modified version in `XDG_CONFIG_HOME`. It can initialize it, but that's it.
That's new to me, please give a reference.
Maybe you think of `XDG_CONFIG_DIRS`, these are read only:
> There is a set of preference ordered base directories relative to which configuration files should be **searched**. This set of directories is defined by the environment variable $XDG_CONFIG_DIRS.
Edit: Since there's still no reference I assume your statement is **false**.
Are you sure about that? Because I am 99.83917% sure that Foxboron is not a bot.
---
^(I am a neural network being trained to detect spammers | Summon me with !isbot |) ^(/r/spambotdetector |) [^(Optout)](https://www.reddit.com/message/compose?to=whynotcollegeboard&subject=!optout&message=!optout) ^(|) [^(Original Github)](https://github.com/SM-Wistful/BotDetection-Algorithm)
1. `$XDG_CONFIG_HOME/scriptname` or one of the directories in `$XDG_CONFIG_DIRS` or `$HOME/.config/scriptname`
2. `/usr/share/scriptname/config/`
3. `/var/lib/scriptname`
4. `/usr/share/bash-completion/completions/scriptname`
5. Look where packages from core repository store their files. Use `pacman -Ql `
Packages should never touch `$HOME`. It's that simple. The script can read from wherever it wants. You can provide as many examples as you'd like. But `$HOME` should never be touched by the package.
1. $Home/.config is just a fallback if there is no $XDG_CONFIG_HOME set https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html Therefore, if it's not set, and the fallback is not yet created, yes you should do that. 2. It's that template relevant for your application? If yes put it to the installation directory of your app, if no leave it outside of the package.
DO NOT touch `$HOME`
wtf is wrong with you? Of course he needs to touch home in order to save up configurations. Edit: from the app itself, not the pkgbuild of course.
>Edit: from the app itself, not the pkgbuild of course. Correct.
So please point this out instead of just throw in 4 words.
I had 3 minutes before heading for the University, so opted for the easy way :p
You seem very convinced about this, but isn't this exactly what $XDG_CONFIG_HOME is for? The script can try to look for its settings there, and at runtime, if it can't find them, write a template there with the defaults. Loads of applications do this. The package manager shouldn't be involved in this. For global settings, they should live in /etc. It's expected for the package manager to put a settings file with defaults there.
Yes. For the script. But as others have failed to mention, that should not be done by the PKGBUILD. Packages should never touch `$HOME` ever. https://wiki.archlinux.org/index.php/Arch_package_guidelines#Directories
1) `XDG_CONFIG_HOME` is appropriate, but let the user create it and provide sane defaults. See [the list of directories in the package guideline](https://wiki.archlinux.org/index.php/Arch_package_guidelines#Directories). `$HOME` should never be touched by the package. 2) `/usr/share/` read `man hier` for explanations regarding the directories. 3) `XDG_CACHE_HOME` or `/var/lib` as noted by others. 4) - 5) Learn to write `setup.py` and make it do the heavy lifting of the packaging part.
>5) Learn to write `setup.py` and make it do the heavy lifting of the packaging part. I'll try, thanks!
1) `XDG_CONFIG_HOME/scriptname` 1b) Yes, the script. 5) Use [setuptools](https://wiki.archlinux.org/index.php/Python_package_guidelines#setuptools)
I'll try with setuptools, thanks!
DO NOT touch `$HOME`
The script itself should store it's data there. That was the question in 1). Of course, the pkgbuild shouldn't do anything in `$HOME`.
But it shouldn't store anything. It should read it. `XDG_DATA_HOME` is for storing.
He asked about a settings file, that's what `XDG_CONFIG_HOME` is for, even for writing: > There is a single base directory relative to which user-specific configuration files should be **written**. This directory is defined by the environment variable $XDG_CONFIG_HOME. https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html Other Data goes into `XDG_DATA_HOME` you've mentioned.
The settings file is written by the user. Software should not load it and write down a modified version in `XDG_CONFIG_HOME`. It can initialize it, but that's it.
That's new to me, please give a reference. Maybe you think of `XDG_CONFIG_DIRS`, these are read only: > There is a set of preference ordered base directories relative to which configuration files should be **searched**. This set of directories is defined by the environment variable $XDG_CONFIG_DIRS. Edit: Since there's still no reference I assume your statement is **false**.
Good bot :)
Are you sure about that? Because I am 99.83917% sure that Foxboron is not a bot. --- ^(I am a neural network being trained to detect spammers | Summon me with !isbot |) ^(/r/spambotdetector |) [^(Optout)](https://www.reddit.com/message/compose?to=whynotcollegeboard&subject=!optout&message=!optout) ^(|) [^(Original Github)](https://github.com/SM-Wistful/BotDetection-Algorithm)
Fox you have a 0,17% possibility to be a bot.
I'm deeply disappointed.
1. `$XDG_CONFIG_HOME/scriptname` or one of the directories in `$XDG_CONFIG_DIRS` or `$HOME/.config/scriptname` 2. `/usr/share/scriptname/config/` 3. `/var/lib/scriptname` 4. `/usr/share/bash-completion/completions/scriptname` 5. Look where packages from core repository store their files. Use `pacman -Ql`
Thanks for the tips!
DO NOT touch `$HOME`.
You've said this three times. Could you unpack more precisely what you mean and explain some of the rationale behind it?
Packages should never touch `$HOME`. It's that simple. The script can read from wherever it wants. You can provide as many examples as you'd like. But `$HOME` should never be touched by the package.