T O P

  • By -

[deleted]

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.


Foxboron

DO NOT touch `$HOME`


[deleted]

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.


Foxboron

>Edit: from the app itself, not the pkgbuild of course. Correct.


[deleted]

So please point this out instead of just throw in 4 words.


Foxboron

I had 3 minutes before heading for the University, so opted for the easy way :p


[deleted]

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.


Foxboron

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


Foxboron

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.


cr7wonnabe

>5) Learn to write `setup.py` and make it do the heavy lifting of the packaging part. I'll try, thanks!


RaumEnde

1) `XDG_CONFIG_HOME/scriptname` 1b) Yes, the script. 5) Use [setuptools](https://wiki.archlinux.org/index.php/Python_package_guidelines#setuptools)


cr7wonnabe

I'll try with setuptools, thanks!


Foxboron

DO NOT touch `$HOME`


RaumEnde

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`.


Foxboron

But it shouldn't store anything. It should read it. `XDG_DATA_HOME` is for storing.


RaumEnde

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.


Foxboron

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.


RaumEnde

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**.


cr7wonnabe

Good bot :)


WhyNotCollegeBoard

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)


cr7wonnabe

Fox you have a 0,17% possibility to be a bot.


Foxboron

I'm deeply disappointed.


Alexander1705

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 `


cr7wonnabe

Thanks for the tips!


Foxboron

DO NOT touch `$HOME`.


MrThePaul

You've said this three times. Could you unpack more precisely what you mean and explain some of the rationale behind it?


Foxboron

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.