added exec condition check on image module

This commit is contained in:
Anuragh K P 2023-01-29 10:41:24 +05:30
parent 9068b7548f
commit 012baadaca
1 changed files with 5 additions and 1 deletions

View File

@ -44,11 +44,15 @@ auto waybar::modules::Image::update() -> void {
{ {
path_ = config_["path"].asString(); path_ = config_["path"].asString();
} }
else else if(config_['exec'].isString())
{ {
output_ = util::command::exec(config_["exec"].asString()); output_ = util::command::exec(config_["exec"].asString());
path_ =output_.out; path_ =output_.out;
} }
else
{
path_="";
}
if (Glib::file_test(path_, Glib::FILE_TEST_EXISTS)) if (Glib::file_test(path_, Glib::FILE_TEST_EXISTS))
pixbuf = Gdk::Pixbuf::create_from_file(path_, size_, size_); pixbuf = Gdk::Pixbuf::create_from_file(path_, size_, size_);
else else