add ordinal date toolbar format specifier to clock module

This commit is contained in:
Josh Jones
2024-02-04 15:41:39 +01:00
parent 4c5ff80bbd
commit 718dd4afae
2 changed files with 48 additions and 2 deletions

View File

@ -8,6 +8,7 @@ namespace waybar::modules {
const std::string kCldPlaceholder{"calendar"};
const std::string kTZPlaceholder{"tz_list"};
const std::string kOrdPlaceholder{"ordinal_date"};
enum class CldMode { MONTH, YEAR };
enum class WS { LEFT, RIGHT, HIDDEN };
@ -57,6 +58,11 @@ class Clock final : public ALabel {
std::string tzText_{""}; // time zones text to print
util::SleeperThread thread_;
// ordinal date in tooltip
const bool ordInTooltip_;
std::string ordText_{""};
auto get_ordinal_date(const year_month_day& today) -> std::string;
auto getTZtext(sys_seconds now) -> std::string;
auto first_day_of_week() -> weekday;
// Module actions