summaryrefslogtreecommitdiffstats
path: root/src/constants.rs
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2021-04-22 23:43:12 -0400
committerGitHub <noreply@github.com>2021-04-22 23:43:12 -0400
commitf33bb42c5b234183117fa30d87b1fe6d9ab94d69 (patch)
tree8fc79336c49b39f412e3f2c6e5a46c53aa920943 /src/constants.rs
parentd9fd6be2ccad9d2eec888bd761cefc9ecbc16298 (diff)
feature: Add mount filtering, rework filter priority logic (#455)
This PR accomplishes two things: 1. This PR aims to add mount_filter to the config file. This allows a user to filter their disk widget entries by the mount name as well; this was particularly a problem in trying to address #431. 2. A slight rework of how the filter system works due to the need of being able to manage two potentially conflicting filter sources, since the disk widget will now potentially filter on both the disk name and the mount name. In regards to the second point, the new behaviour is as such: 1. Is the entry allowed through any filter? That is, does it match an entry in a filter where is_list_ignored is false? If so, we always keep this entry. 2. Is the entry denied through any filter? That is, does it match an entry in a filter where is_list_ignored is true? If so, we always deny this entry. 3. Anything else is allowed. This main (breaking) change is really the third point. This would mean that temp_filter and net_filter, when set to allow listed entries with is_list_ignored = false, are kinda... useless, as a whitelist in the scenario of being the only filter is kinda pointless. But hopefully this shouldn't be a problem...?
Diffstat (limited to 'src/constants.rs')
-rw-r--r--src/constants.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/constants.rs b/src/constants.rs
index 3a58c51c..713e7dcc 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -565,24 +565,31 @@ pub const OLD_CONFIG_TEXT: &str = r##"# This is a default config file for bottom
# default=true
-# Filters - you can hide specific temperature and disks using filters. This is admittedly a bit
-# hard to use as of now, and there is a planned interface for managing this in the future:
+# Filters - you can hide specific temperature sensors, network interfaces, and disks using filters. This is admittedly
+# a bit hard to use as of now, and there is a planned in-app interface for managing this in the future:
#[disk_filter]
-#is_list_ignored = false
+#is_list_ignored = true
#list = ["/dev/sda\\d+", "/dev/nvme0n1p2"]
#regex = true
#case_sensitive = false
#whole_word = false
+#[mount_filter]
+#is_list_ignored = true
+#list = ["/mnt/.*", "/boot"]
+#regex = true
+#case_sensitive = false
+#whole_word = false
+
#[temp_filter]
-#is_list_ignored = false
+#is_list_ignored = true
#list = ["cpu", "wifi"]
#regex = false
#case_sensitive = false
#whole_word = false
#[net_filter]
-#is_list_ignored = false
+#is_list_ignored = true
#list = ["virbr0.*"]
#regex = true
#case_sensitive = false