mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-28 23:12:29 +01:00 
			
		
		
		
	fix(battery): adapter status
This commit is contained in:
		| @@ -145,15 +145,15 @@ const std::string waybar::modules::Battery::getState(uint8_t capacity) const | ||||
| auto waybar::modules::Battery::update() -> void | ||||
| { | ||||
|   auto [capacity, status] = getInfos(); | ||||
|   if (status == "Unknown") { | ||||
|     status = getAdapterStatus(capacity); | ||||
|   } | ||||
|   label_.set_tooltip_text(status); | ||||
|   std::transform(status.begin(), status.end(), status.begin(), ::tolower); | ||||
|   auto format = format_; | ||||
|   auto state = getState(capacity); | ||||
|   label_.get_style_context()->remove_class(old_status_); | ||||
|   label_.get_style_context()->add_class(status); | ||||
|   if (status == "Unknown") { | ||||
|     status = getAdapterStatus(capacity); | ||||
|   } | ||||
|   old_status_ = status; | ||||
|   if (!state.empty() && config_["format-" + status + "-" + state].isString()) { | ||||
|     format = config_["format-" + status + "-" + state].asString(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alexis
					Alexis