about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-08-28 08:30:52 +0200
committerhut <hut@lavabit.com>2010-08-28 08:30:52 +0200
commita2853ab67f2e471d9a34b4c528db6ee2024ef874 (patch)
treecf2f7e32433cd49f592399e1624428e561a7c3e6 /ranger
parent56f380c61f62a18b39375da7e7cd93d443be8aef (diff)
downloadranger-a2853ab67f2e471d9a34b4c528db6ee2024ef874.tar.gz
Changed default config dir to $XDG_CONFIG_HOME/ranger
Diffstat (limited to 'ranger')
-rw-r--r--ranger/__init__.py5
-rw-r--r--ranger/__main__.py2
-rw-r--r--ranger/core/actions.py2
-rw-r--r--ranger/defaults/apps.py4
-rw-r--r--ranger/defaults/commands.py2
-rw-r--r--ranger/defaults/keys.py2
-rw-r--r--ranger/defaults/options.py2
-rw-r--r--ranger/gui/colorscheme.py6
8 files changed, 14 insertions, 11 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index e0e8e1bf..57e0e5a2 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -31,7 +31,10 @@ Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
 """
 
 USAGE = '%prog [options] [path/filename]'
-DEFAULT_CONFDIR = '~/.ranger'
+if 'XDG_CONFIG_HOME' in os.environ and os.environ['XDG_CONFIG_HOME']:
+	DEFAULT_CONFDIR = os.environ['XDG_CONFIG_HOME'] + '/ranger'
+else:
+	DEFAULT_CONFDIR = '~/.config/ranger'
 RANGERDIR = os.path.dirname(__file__)
 LOGFILE = '/tmp/errorlog'
 arg = OpenStruct(
diff --git a/ranger/__main__.py b/ranger/__main__.py
index b3a41776..28284ef5 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -113,7 +113,7 @@ def load_settings(fm, clean):
 			pass
 		# COMPAT WARNING
 		if hasattr(keys, 'initialize_commands'):
-			print("Warning: the syntax for ~/.ranger/keys.py has changed.")
+			print("Warning: the syntax for ~/.config/ranger/keys.py has changed.")
 			print("Your custom keys are not loaded."\
 					"  Please update your configuration.")
 		allow_access_to_confdir(ranger.arg.confdir, False)
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index d12d9c6c..a5ee0d4d 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -423,7 +423,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 	# --------------------------
 	# -- Tags
 	# --------------------------
-	# Tags are saved in ~/.ranger/tagged and simply mark if a
+	# Tags are saved in ~/.config/ranger/tagged and simply mark if a
 	# file is important to you in any context.
 
 	def tag_toggle(self, movedown=None):
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index 48735196..47eff0c9 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -17,13 +17,13 @@
 This is the default ranger configuration file for filetype detection
 and application handling.
 
-You can place this file in your ~/.ranger/ directory and it will be used
+You can place this file in your ~/.config/ranger/ directory and it will be used
 instead of this one.  Though, to minimize your effort when upgrading ranger,
 you may want to subclass CustomApplications rather than making a full copy.
             
 This example modifies the behaviour of "feh" and adds a custom media player:
 
-#### start of the ~/.ranger/apps.py example
+#### start of the ~/.config/ranger/apps.py example
 	from ranger.defaults.apps import CustomApplications as DefaultApps
 	from ranger.api.apps import *
 			
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py
index f1c92274..b6bf7e2b 100644
--- a/ranger/defaults/commands.py
+++ b/ranger/defaults/commands.py
@@ -32,7 +32,7 @@ The return value for quick() can be:
 The return value for execute() doesn't matter.
 
 If you want to add custom commands, you can create a file
-~/.ranger/commands.py, add the line:
+~/.config/ranger/commands.py, add the line:
 	from ranger.api.commands import *
 
 and write some command definitions, for example:
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index e72f4c91..7d8ccc4a 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -58,7 +58,7 @@ dgg       => fm.cut(foo=bar, dirarg=Direction(to=0))
 5dgg      => fm.cut(foo=bar, narg=5, dirarg=Direction(to=0))
 5d3gg     => fm.cut(foo=bar, narg=5, dirarg=Direction(to=3))
 
-Example ~/.ranger/keys.py
+Example ~/.config/ranger/keys.py
 -------------------------
 from ranger.api.keys import *
 
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index d3c420af..126d4bad 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -17,7 +17,7 @@
 This is the default configuration file of ranger.
 
 There are two ways of customizing ranger.  The first and recommended
-method is creating a file at ~/.ranger/options.py and adding
+method is creating a file at ~/.config/ranger/options.py and adding
 those lines you want to change.  It might look like this:
 
 from ranger.api.options import *
diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py
index 501b8788..5b317acb 100644
--- a/ranger/gui/colorscheme.py
+++ b/ranger/gui/colorscheme.py
@@ -24,7 +24,7 @@ The values are specified in ranger.gui.color.
 A colorscheme must...
 
 1. be inside either of these directories:
-~/.ranger/colorschemes/
+~/.config/ranger/colorschemes/
 path/to/ranger/colorschemes/
 
 2. be a subclass of ranger.gui.colorscheme.ColorScheme
@@ -121,7 +121,7 @@ class ColorScheme(SettingsAware):
 		return fg, -1, attr
 
 def _colorscheme_name_to_class(signal):
-	# Find the colorscheme.  First look for it at ~/.ranger/colorschemes,
+	# Find the colorscheme.  First look for it at ~/.config/ranger/colorschemes,
 	# then at RANGERDIR/colorschemes.  If the file contains a class
 	# named Scheme, it is used.  Otherwise, an arbitrary other class
 	# is picked.
@@ -139,7 +139,7 @@ def _colorscheme_name_to_class(signal):
 		except:
 			return False
 
-	# create ~/.ranger/colorschemes/__init__.py if it doesn't exist
+	# create ~/.config/ranger/colorschemes/__init__.py if it doesn't exist
 	if usecustom:
 		if os.path.exists(ranger.relpath_conf('colorschemes')):
 			initpy = ranger.relpath_conf('colorschemes', '__init__.py')