feat(network): add rfkill setting
This setting makes it possible to have a configuration with two network modules where one of them displays the ethernet state (disconnected, linked, ethernet), and the other, the wifi state (disabled, disconnected, linked, wifi). Otherwise the ethernet state would show up as "disabled" (instead of "disconnected") when rfkill is active.
This commit is contained in:
@ -273,7 +273,11 @@ void waybar::modules::Network::worker() {
|
||||
const std::string waybar::modules::Network::getNetworkState() const {
|
||||
if (ifid_ == -1 || !carrier_) {
|
||||
#ifdef WANT_RFKILL
|
||||
if (rfkill_.getState()) return "disabled";
|
||||
bool display_rfkill = true;
|
||||
if (config_["rfkill"].isBool()) {
|
||||
display_rfkill = config_["rfkill"].asBool();
|
||||
}
|
||||
if (rfkill_.getState() && display_rfkill) return "disabled";
|
||||
#endif
|
||||
return "disconnected";
|
||||
}
|
||||
|
Reference in New Issue
Block a user