summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2018-05-09 00:02:40 +0200
committertoonn <toonn@toonn.io>2018-05-09 00:02:40 +0200
commit2d402b80ae22b7da8ef430a93f4755eec63c679d (patch)
treef2b012342c51efbae36dab3c0667b5226cb87006
parentea943048d453bff900d310110ac7227bcc126683 (diff)
parented4eb4bf282354886e52ae6fa92bf68078edfef6 (diff)
Merge branch 'custom_free_space'
-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: