MCPcopy Create free account
hub / github.com/Alexays/Waybar / getNetworkState

Method getNetworkState

src/modules/network.cpp:260–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260const std::string waybar::modules::Network::getNetworkState() const {
261 if (ifid_ == -1 || !carrier_) {
262#ifdef WANT_RFKILL
263 bool display_rfkill = true;
264 if (config_["rfkill"].isBool()) {
265 display_rfkill = config_["rfkill"].asBool();
266 }
267 if (rfkill_.getState() && display_rfkill) return "disabled";
268#endif
269 return "disconnected";
270 }
271 if (ipaddr_.empty() && ipaddr6_.empty()) return "linked";
272 if (essid_.empty()) return "ethernet";
273 return "wifi";
274}
275
276auto waybar::modules::Network::update() -> void {
277 std::lock_guard<std::mutex> lock(mutex_);

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
getStateMethod · 0.45

Tested by

no test coverage detected