[opensuse-factory] Directory for openSUSE config files in $HOME
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 -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
* Vincent Untz
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. -- Guido Berhoerster -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
-----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) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAk1lZOQACgkQtTMYHG2NR9VpBACeOgBUXXmQauwdTnJwLKLXpNr1 /IEAnjZLGQFxiVOwj1VfBWMYlEaOT0GP =kmgU -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
participants (3)
-
Carlos E. R.
-
Guido Berhoerster
-
Vincent Untz