Debian Codegraph @

docs/content/configuration/config-file/disk-table.md

raw symbols SCIP
1 # Disk Table Configuration
2
3 ## Columns
4
5 You can configure which columns are shown by the disk table widget by setting the `columns` setting:
6
7 ```toml
8 [disk]
9 # Pick which columns you want to use in any order.
10 columns = ["Disk", "Mount", "Used", "Free", "Total", "Used%", "R/s", "W/s"]
11 ```
12
13 ## Default Sort Column
14
15 You can customize the default sort column (by default, it sorts by disk name in ascending order). For example, to sort by the read rate:
16
17 ```toml
18 [disk]
19 default_sort = "R/s"
20 ```
21
22 You can use any valid [column](#columns) name here (e.g. "Disk", "Mount", etc.). Note that if you put a column name that
23 is not actually used, the default sort will just be the first column shown.
24
25 You can also set the sort order by changing `disk.sort_order` with `"Ascending"` or `"Descending"`. Defaults to
26 `"Ascending"`:
27
28 ```toml
29 [disk]
30 sort_order = "Ascending"
31 ```
32
33 ## Show Unmounted Devices (Linux only)
34
35 By default, only mounted devices are shown. To also show unmounted devices on Linux, enable `include_unmounted`:
36
37 ```toml
38 [disk]
39 include_unmounted = true
40 ```
41
42 Unmounted devices show I/O activity but have no used/free space (those require a live mount), so those
43 columns appear as `N/A`. Pseudo-devices (`loop*`, `ram*`, `zram*`) are skipped, and you can hide other
44 noisy devices with the [name filter](#filtering-entries).
45
46 ## Filtering Entries
47
48 You can filter out what entries to show by configuring `[disk.name_filter]` and `[disk.mount_filter]` to filter by name and mount point respectively. In particular,
49 you can set a list of things to filter with by setting `list`, and configure how that list
50 is processed with the other options.
51
52 For example, consider a disk widget showing these entries:
53
54 ![Disk no filter](../../assets/screenshots/config/disk-filtering/disk_no_filter.webp)
55
56 If we wanted to ignoring any entry with a name that matches `/dev/sda`:
57
58 ```toml
59 [disk.name_filter]
60 # Whether to ignore any matches. Defaults to true.
61 is_list_ignored = true
62
63 # A list of filters to try and match.
64 list = ["/dev/sda"]
65
66 # Whether to use regex. Defaults to false.
67 regex = true
68
69 # Whether to be case-sensitive. Defaults to false.
70 case_sensitive = false
71
72 # Whether to require matching the whole word. Defaults to false.
73 whole_word = false
74 ```
75
76 This would give us:
77
78 ![Disk widget with just disk name filter](../../assets/screenshots/config/disk-filtering/disk_name_filter.webp)
79
80 We can also combine both the name filter and mount filter. For example:
81
82 ```toml
83 [disk.name_filter]
84 is_list_ignored = false
85 list = ["/dev/sda"]
86 regex = true
87 case_sensitive = false
88 whole_word = false
89
90 [disk.mount_filter]
91 is_list_ignored = true
92 list = ["/mnt/.*", "/"]
93 regex = true
94 case_sensitive = false
95 whole_word = true
96 ```
97
98 This gives us:
99
100 ![Disk widget with disk name and mount filter](../../assets/screenshots/config/disk-filtering/disk_name_mount_filter.webp)