diff --git a/_c4ctrl b/_c4ctrl index 85e7d67..02da2f6 100644 --- a/_c4ctrl +++ b/_c4ctrl @@ -41,8 +41,8 @@ case "$state" in _values Presets 'off' 'random' ret=$? fi - if [[ "$XDG_CONFIG_DIR" ]]; then - c4ctrl_cfg_dir="$XDG_CONFIG_DIR/c4ctrl" + if [[ "$XDG_CONFIG_HOME" ]]; then + c4ctrl_cfg_dir="$XDG_CONFIG_HOME/c4ctrl" else c4ctrl_cfg_dir="$HOME/.config/c4ctrl" fi diff --git a/c4ctrl.py b/c4ctrl.py index 4e3c668..5100535 100755 --- a/c4ctrl.py +++ b/c4ctrl.py @@ -788,16 +788,16 @@ class ColorScheme: import os # The name of our config directory. - XDG_NAME = "c4ctrl" + _NAME = "c4ctrl" - # Get XDG_CONFIG_DIR from environment or set default. - if "XDG_CONFIG_DIR" in os.environ: - XDG_CONFIG_DIR = os.environ["XDG_CONFIG_DIR"] + # Get XDG_CONFIG_HOME from environment or set default. + if "XDG_CONFIG_HOME" in os.environ: + XDG_CONFIG_HOME = os.environ["XDG_CONFIG_HOME"] else: - XDG_CONFIG_DIR = os.path.expanduser(os.path.join("~", ".config")) + XDG_CONFIG_HOME = os.path.expanduser(os.path.join("~", ".config")) # Does our config dir exist? - config_dir = os.path.join(XDG_CONFIG_DIR, XDG_NAME) + config_dir = os.path.join(XDG_CONFIG_HOME, _NAME) if not os.path.isdir(config_dir): if create: print("Creating config directory \"{}\"".format(config_dir)) diff --git a/c4ctrl.vim b/c4ctrl.vim index 4e79465..6102c83 100644 --- a/c4ctrl.vim +++ b/c4ctrl.vim @@ -25,8 +25,8 @@ function s:FindConfigDir() " {{{1 return s:config_dir endif - if expand("$XDG_CONFIG_DIR") != "$XDG_CONFIG_DIR" - let s:config_dir = expand("$XDG_CONFIG_DIR/c4ctrl/") + if expand("$XDG_CONFIG_HOME") != "$XDG_CONFIG_HOME" + let s:config_dir = expand("$XDG_CONFIG_HOME/c4ctrl/") else let s:config_dir = expand("$HOME/.config/c4ctrl/") endif diff --git a/examples/beach b/examples/beach index 422d778..79de719 100644 --- a/examples/beach +++ b/examples/beach @@ -1,7 +1,7 @@ # "Beach" colorscheme for c4ctrl -# Put this file into "$XDG_CONFIG_DIR/c4ctrl/" (likely "~/.config/c4ctrl/") to -# make it available to c4ctrl.py. +# Put this file into "$XDG_CONFIG_HOME/c4ctrl/" (defaults to +# "~/.config/c4ctrl/") to make it available to c4ctrl.py. # Wohnzimmer + Küche #dmx/wohnzimmer/master = 3300ff diff --git a/examples/emergency b/examples/emergency index 19c757e..2d9a4ba 100644 --- a/examples/emergency +++ b/examples/emergency @@ -1,7 +1,7 @@ # "Emergency" colorscheme for c4ctrl -# Put this file into "$XDG_CONFIG_DIR/c4ctrl/" (likely "~/.config/c4ctrl/") to -# make it available to c4ctrl.py. +# Put this file into "$XDG_CONFIG_HOME/c4ctrl/" (defaults to +# "~/.config/c4ctrl/") to make it available to c4ctrl.py. # This preset uses some more advanced features of the LED cans in the club. # The following table lists their options. # diff --git a/examples/neon b/examples/neon index d298674..a030814 100644 --- a/examples/neon +++ b/examples/neon @@ -1,7 +1,7 @@ # "Neon" colorscheme for c4ctrl -# Put this file into "$XDG_CONFIG_DIR/c4ctrl/" (likely "~/.config/c4ctrl/") to -# make it available to c4ctrl.py. +# Put this file into "$XDG_CONFIG_HOME/c4ctrl/" (defaults to +# "~/.config/c4ctrl/") to make it available to c4ctrl.py. # Wohnzimmer + Küche #dmx/wohnzimmer/master = 0033ff