diff --git a/man/waybar-custom.5.scd b/man/waybar-custom.5.scd index 92eda6cd..905dbc1a 100644 --- a/man/waybar-custom.5.scd +++ b/man/waybar-custom.5.scd @@ -33,11 +33,11 @@ Addressed by *custom/* You can update it manually with a signal. If no *interval* is defined, it is assumed that the out script loops it self. -*restart_interval*: ++ +*restart-interval*: ++ typeof: integer ++ The restart interval (in seconds). Can't be used with the *interval* option, so only with continuous scripts. - Once the scripts exit, it'll be re-executed after the *restart_interval*. + Once the script exit, it'll be re-executed after the *restart-interval*. *signal*: ++ typeof: integer ++ diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index cbc865d6..c81f1922 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -60,13 +60,13 @@ void waybar::modules::Custom::continuousWorker() { dp.emit(); spdlog::error("{} stopped unexpectedly, is it endless?", name_); } - if (config_["restart_interval"].isUInt()) { + if (config_["restart-interval"].isUInt()) { pid_ = -1; fp_ = util::command::open(cmd, pid_); if (!fp_) { throw std::runtime_error("Unable to open " + cmd); } - thread_.sleep_for(std::chrono::seconds(config_["restart_interval"].asUInt()); + thread_.sleep_for(std::chrono::seconds(config_["restart-interval"].asUInt()); } else { thread_.stop(); }