mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(Custom): handle continuous script
This commit is contained in:
@ -13,7 +13,8 @@ class Custom : public ALabel {
|
||||
Custom(const std::string, const Json::Value&);
|
||||
auto update() -> void;
|
||||
private:
|
||||
void worker();
|
||||
void delayWorker();
|
||||
void continuousWorker();
|
||||
|
||||
const std::string name_;
|
||||
waybar::util::SleeperThread thread_;
|
||||
|
@ -70,7 +70,7 @@ struct SleeperThread {
|
||||
condvar_.notify_all();
|
||||
}
|
||||
|
||||
~SleeperThread()
|
||||
auto stop()
|
||||
{
|
||||
do_run_ = false;
|
||||
condvar_.notify_all();
|
||||
@ -79,6 +79,11 @@ struct SleeperThread {
|
||||
}
|
||||
}
|
||||
|
||||
~SleeperThread()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
private:
|
||||
std::thread thread_;
|
||||
std::condition_variable condvar_;
|
||||
|
Reference in New Issue
Block a user