about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--doc/ranger.13
-rw-r--r--doc/ranger.pod4
-rw-r--r--examples/rc_emacs.conf3
-rw-r--r--ranger/config/rc.conf3
-rw-r--r--ranger/container/settings.py1
-rw-r--r--ranger/gui/widgets/statusbar.py15
6 files changed, 22 insertions, 7 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1
index 6358e1d6..c48f73d9 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -766,6 +766,9 @@ Display the file size in the main column?
 Display the file size in the status bar?
 .IP "display_tags_in_all_columns [bool]" 4
 .IX Item "display_tags_in_all_columns [bool]"
+Display the free disk space in the status bar?
+.IP "display_free_space_in_status_bar [bool]" 4
+.IX Item "display_free_space_in_status_bar [bool]"
 Display tags in all columns?
 .IP "draw_borders [bool]" 4
 .IX Item "draw_borders [bool]"
diff --git a/doc/ranger.pod b/doc/ranger.pod
index 9fb4cf0d..d36db622 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -752,6 +752,10 @@ Display the file size in the main column?
 
 Display the file size in the status bar?
 
+=item display_free_space_in_status_bar [bool]
+
+Display the free disk space in the status bar?
+
 =item display_tags_in_all_columns [bool]
 
 Display tags in all columns?
diff --git a/examples/rc_emacs.conf b/examples/rc_emacs.conf
index 8924d1d6..0462282e 100644
--- a/examples/rc_emacs.conf
+++ b/examples/rc_emacs.conf
@@ -122,6 +122,9 @@ set mouse_enabled true
 set display_size_in_main_column true
 set display_size_in_status_bar true
 
+# Display the free disk space in the status bar?
+set display_free_space_in_status_bar true
+
 # Display files tags in all columns or only in main column?
 set display_tags_in_all_columns true
 
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index ff1cc783..00dc02f8 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -138,6 +138,9 @@ set mouse_enabled true
 set display_size_in_main_column true
 set display_size_in_status_bar true
 
+# Display the free disk space in the status bar?
+set display_free_space_in_status_bar true
+
 # Display files tags in all columns or only in main column?
 set display_tags_in_all_columns true
 
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index 9f54f24d..170ace5a 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -38,6 +38,7 @@ ALLOWED_SETTINGS = {
     'dirname_in_tabs': bool,
     'display_size_in_main_column': bool,
     'display_size_in_status_bar': bool,
+    "display_free_space_in_status_bar": bool,
     'display_tags_in_all_columns': bool,
     'draw_borders': bool,
     'draw_progress_bar_in_status_bar': bool,
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 266d48ca..3457955e 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -275,13 +275,14 @@ class StatusBar(Widget):  # pylint: disable=too-many-instance-attributes
             right.add("/" + str(len(target.marked_items)))
         else:
             right.add(human_readable(target.disk_usage, separator='') + " sum")
-            try:
-                free = get_free_space(target.mount_path)
-            except OSError:
-                pass
-            else:
-                right.add(", ", "space")
-                right.add(human_readable(free, separator='') + " free")
+            if self.settings.display_free_space_in_status_bar:
+                try:
+                    free = get_free_space(target.mount_path)
+                except OSError:
+                    pass
+                else:
+                    right.add(", ", "space")
+                    right.add(human_readable(free, separator='') + " free")
         right.add("  ", "space")
 
         if target.marked_items: