fs: fallback if no mountpoints specified (#2705)

Ref #2572
This commit is contained in:
Mathis Weber 2022-05-02 12:54:03 +02:00 committed by GitHub
parent f9fc02e69c
commit 423cc1720f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added experimental support for positioning the tray like a module
- `internal/backlight`: `scroll-interval` option ([`#2696`](https://github.com/polybar/polybar/issues/2696), [`#2700`](https://github.com/polybar/polybar/pull/2700))
### Changed
- `internal/fs`: Use `/` as a fallback if no mountpoints are specified ([`#2572`](https://github.com/polybar/polybar/issues/2572), [`#2705`](https://github.com/polybar/polybar/pull/2705))
### Fixed
- Waiting for double click interval on modules that don't have a double click action ([`#2663`](https://github.com/polybar/polybar/issues/2663), [`#2695`](https://github.com/polybar/polybar/pull/2695))

View File

@ -27,7 +27,11 @@ namespace modules {
* setting up required components
*/
fs_module::fs_module(const bar_settings& bar, string name_) : timer_module<fs_module>(bar, move(name_)) {
m_mountpoints = m_conf.get_list(name(), "mount");
m_mountpoints = m_conf.get_list(name(), "mount", {});
if (m_mountpoints.empty()) {
m_log.info("%s: No mountpoints specified, using fallback \"/\"", name());
m_mountpoints.emplace_back("/");
}
m_remove_unmounted = m_conf.get(name(), "remove-unmounted", m_remove_unmounted);
m_perc_used_warn = m_conf.get(name(), "warn-percentage", 90);
m_fixed = m_conf.get(name(), "fixed-values", m_fixed);