FreeBSD: Add support to battery

This commit aims to propose a FreeBSD to gain battery support using sysctl on hw.acpi.battery.*
This commit is contained in:
Loïc Bartoletti
2022-09-30 21:59:27 +02:00
parent a7e6330078
commit 830c5cd5d0
4 changed files with 84 additions and 4 deletions

View File

@ -7,7 +7,7 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const {
auto hash_pos = name.find('#');
auto ref = name.substr(0, hash_pos);
auto id = hash_pos != std::string::npos ? name.substr(hash_pos + 1) : "";
#if defined(__linux__) && !defined(NO_FILESYSTEM)
#if defined(__FreeBSD__) || (defined(__linux__) && !defined(NO_FILESYSTEM))
if (ref == "battery") {
return new waybar::modules::Battery(id, config_[name]);
}