diff --git a/include/modules/sway/language.hpp b/include/modules/sway/language.hpp index 19441668..92e2bbaa 100644 --- a/include/modules/sway/language.hpp +++ b/include/modules/sway/language.hpp @@ -32,12 +32,7 @@ class Language : public ALabel, public sigc::trackable { std::string short_name; std::string variant; std::string short_description; - std::string country_flag() const { - static std::string result = "\xf0\x9f\x87\xff\xf0\x9f\x87\xff"; - result[3] = short_name[0] - 0xbb; - result[7] = short_name[1] - 0xbb; - return result; - } + std::string country_flag() const; }; class XKBContext { diff --git a/src/modules/sway/language.cpp b/src/modules/sway/language.cpp index bdd4b998..1b12ab05 100644 --- a/src/modules/sway/language.cpp +++ b/src/modules/sway/language.cpp @@ -213,4 +213,11 @@ Language::XKBContext::~XKBContext() { rxkb_context_unref(context_); delete layout_; } + +std::string Language::Layout::country_flag() const { + static std::string result = "\xf0\x9f\x87\xff\xf0\x9f\x87\xff"; + result[3] = short_name[0] - 0xbb; + result[7] = short_name[1] - 0xbb; + return result; +} } // namespace waybar::modules::sway