summaryrefslogtreecommitdiffstats
path: root/docs/content/configuration/config-file/data-filtering.md
blob: 92a4c2a2aed682ae797fd9694859972f0f5ff84f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Data Filtering

!!! Warning

    This section is in progress, and is just copied from the old documentation.

You can hide specific disks, temperature sensors, and networks by name in the config file via `disk_filter` and `mount_filter`, `temp_filter`, and `net_filter` respectively. Regex (`regex = true`), case-sensitivity (`case_sensitive = true`), and matching only if the entire word matches (`whole_word = true`) are supported, but are off by default. Filters default to denying entries that match and can be toggled by setting `is_list_ignored` to `false` in the config file.

For example, here's the disk widget with no filter:

![Disk no filter](../../../assets/screenshots/config/disk-filtering/disk_no_filter.webp)

The following in the config file would filter out some entries by disk name:

```toml
[disk_filter]
is_list_ignored = true
list = ["/dev/sda"]
regex = true
case_sensitive = false
whole_word = false
```

![Disk widget with just disk name filter](../../../assets/screenshots/config/disk-filtering/disk_name_filter.webp)

If there are two potentially conflicting filters (i.e. when you are using both a disk and mount filter), the filter that explicitly allows an entry takes precedence over a filter that explicitly denies one. So for example, let's say we set a disk filter accepting anything with `/dev/sda`, but deny anything with `/mnt/.*` or `/`. So to do so, we write in the config file:

```toml
[disk_filter]
is_list_ignored = false
list = ["/dev/sda"]
regex = true
case_sensitive = false
whole_word = false

[mount_filter]
is_list_ignored = true
list = ["/mnt/.*", "/"]
regex = true
case_sensitive = false
whole_word = true
```

This gives us:

![Disk widget with disk name and mount filter](../../../assets/screenshots/config/disk-filtering/disk_name_mount_filter.webp)