Hi,
As I needed a directory to put some openSUSE-specific data for each user, I was looking at what directory to use. I was not aware of any such directory, so after quickly asking around, I decided to use this:
if test "x$XDG_CONFIG_HOME" = "x"; then XDG_CONFIG_HOME="$HOME/.config" fi SUSE_DIR="$XDG_CONFIG_HOME/suse"
So if anybody else needs a directory like that, please use the same one.
Note that XDG_CONFIG_HOME should be created with "mkdir -p -m 0700". Doing "mkdir -p -m 0700 $SUSE_DIR" will not create XDG_CONFIG_HOME with the right permissions, as far as I can tell (don't know if it's a feature or a bug).
Cheers,
Vincent
* Vincent Untz vuntz@opensuse.org [2011-02-22 00:24]:
Hi,
As I needed a directory to put some openSUSE-specific data for each user, I was looking at what directory to use. I was not aware of any such directory, so after quickly asking around, I decided to use this:
if test "x$XDG_CONFIG_HOME" = "x"; then XDG_CONFIG_HOME="$HOME/.config" fi SUSE_DIR="$XDG_CONFIG_HOME/suse"
You can shorten that by taking advantage of parameter expansion:
SUSE_DIR="${XDG_CONFIG_HOME:-${HOME}/.config}/suse"
Note that XDG_CONFIG_HOME should be created with "mkdir -p -m 0700". Doing "mkdir -p -m 0700 $SUSE_DIR" will not create XDG_CONFIG_HOME with the right permissions, as far as I can tell (don't know if it's a feature or a bug).
This is not a bug, POSIX/SUSv4 specifies that all non-existing pathname components except the last on will be created according to the current umask.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tuesday, 2011-02-22 at 00:24 +0100, Vincent Untz wrote:
As I needed a directory to put some openSUSE-specific data for each user, I was looking at what directory to use. I was not aware of any such directory, so after quickly asking around, I decided to use this:
if test "x$XDG_CONFIG_HOME" = "x"; then XDG_CONFIG_HOME="$HOME/.config" fi SUSE_DIR="$XDG_CONFIG_HOME/suse"
That directory is used by many programs.
- -- Cheers, Carlos E. R. (from 11.2 x86_64 "Emerald" at Telcontar)