add clock to bar

This commit is contained in:
2025-12-08 23:41:34 +01:00
commit de6ece13fa
8 changed files with 214 additions and 0 deletions

15
src/widgets/clock.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "widgets/clock.hpp"
#include <chrono>
#include <iomanip>
bool Clock::onUpdate() {
auto now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
std::stringstream ss;
ss << std::put_time(std::localtime(&now), "%H:%M:%S");
set_text(ss.str());
return true;
}