summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-08-23 01:01:50 +0200
committerhut <hut@lavabit.com>2011-08-23 01:01:50 +0200
commitd7051ccbacdb9e313df57d7de5db8ab875f189d9 (patch)
treec6d5730649eca374344e31fd9a13e8d36741ba78 /ranger
parent9bb1444622424eb4fc548c2a0c81c3e73ca8faee (diff)
downloadranger-d7051ccbacdb9e313df57d7de5db8ab875f189d9.tar.gz
defaults/keys: added hints for chmod keys
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/keys.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index 1f4c3332..44d5c0d9 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -201,6 +201,15 @@ for mode in product('ugoa', 'rwxXst'):
 	map('+%s%s' % mode, fm.execute_console('shell chmod %s+%s %%s' % mode))
 	map('=%s%s' % mode, fm.execute_console('shell chmod %s+%s %%s' % mode))
 
+# hints:
+template = '%s %s to *r*ead, *w*rite, e*x*ecute'
+for who, name in zip('ugoa', ('user', 'group', 'others', 'all')):
+	map('-%s<bg>' % who, fm.hint(template % ('forbid', name)))
+	map('+%s<bg>' % who, fm.hint(template % ('allow', name)))
+	map('=%s<bg>' % who, fm.hint(template % ('allow', name)))
+map('-<bg>', '+<bg>', '=<bg>', fm.hint('change permission for *u*ser, '
+	'*g*roup, *o*thers, *a*ll'))
+
 # ---------------------------------------------------- run programs
 map('S', fm.execute_command(os.environ['SHELL']))
 map('E', fm.edit_file())