summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/defaults/keys.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index cd1c5d07..1f4c3332 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -193,6 +193,14 @@ map('phl', fm.paste_hardlink())
 map('u<bg>', fm.hint("un*y*ank, unbook*m*ark, unselect:*v*"))
 map('ud', 'uy', fm.uncut())
 
+# ------------------------------------ changing of file permissions
+# type "+ow" for "chmod o+w %s" and so on
+from itertools import product
+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))
+	map('=%s%s' % mode, fm.execute_console('shell chmod %s+%s %%s' % mode))
+
 # ---------------------------------------------------- run programs
 map('S', fm.execute_command(os.environ['SHELL']))
 map('E', fm.edit_file())