mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-28 23:12:29 +01:00 
			
		
		
		
	Allow custom plugins that don't execute anything
This commit is contained in:
		| @@ -4,13 +4,14 @@ waybar::modules::Custom::Custom(const std::string name, | ||||
|   const Json::Value& config) | ||||
|   : ALabel(config, "{}"), name_(name) | ||||
| { | ||||
|   if (!config_["exec"].isString()) { | ||||
|     throw std::runtime_error(name_ + " has no exec path."); | ||||
|   } | ||||
|   if (interval_.count() > 0) { | ||||
|     delayWorker(); | ||||
|   if (config_["exec"].isString()) { | ||||
|     if (interval_.count() > 0) { | ||||
|       delayWorker(); | ||||
|     } else { | ||||
|       continuousWorker(); | ||||
|     } | ||||
|   } else { | ||||
|     continuousWorker(); | ||||
|       update(); | ||||
|   } | ||||
| } | ||||
|  | ||||
| @@ -66,7 +67,7 @@ void waybar::modules::Custom::continuousWorker() | ||||
| auto waybar::modules::Custom::update() -> void | ||||
| { | ||||
|   // Hide label if output is empty | ||||
|   if (output_.out.empty() || output_.exit_code != 0) { | ||||
|   if (config_["exec"].isString() && (output_.out.empty() || output_.exit_code != 0)) { | ||||
|     label_.hide(); | ||||
|     label_.set_name(""); | ||||
|   } else { | ||||
| @@ -132,4 +133,4 @@ void waybar::modules::Custom::parseOutputJson() | ||||
|     class_ = parsed["class"].asString(); | ||||
|     break; | ||||
|   } | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 David96
					David96