summary refs log tree commit diff stats
path: root/ranger.py
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.py
parent56f380c61f62a18b39375da7e7cd93d443be8aef (diff)
downloadranger-a2853ab67f2e471d9a34b4c528db6ee2024ef874.tar.gz
Changed default config dir to $XDG_CONFIG_HOME/ranger
Diffstat (limited to 'ranger.py')
-rwxr-xr-xranger.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger.py b/ranger.py
index f290d796..cc7f14ed 100755
--- a/ranger.py
+++ b/ranger.py
@@ -23,7 +23,11 @@
 # after you exit ranger by starting it with: source ranger ranger
 """":
 if [ $1 ]; then
-	$@ --fail-unless-cd && cd "$(grep \^\' ~/.ranger/bookmarks | cut -b3-)"
+	if [ -z $XDG_CONFIG_HOME ]; then
+		$@ --fail-unless-cd && cd "$(grep \^\' ~/.config/ranger/bookmarks | cut -b3-)"
+	else
+		$@ --fail-unless-cd && cd "$(grep \^\' "$XDG_CONFIG_HOME"/ranger/bookmarks | cut -b3-)"
+	fi
 else
 	echo "usage: source path/to/ranger.py path/to/ranger.py"
 fi