From 34812c33dbfdac33093c84b3edf5076838cbf2a6 Mon Sep 17 00:00:00 2001 From: Filip Mikina Date: Fri, 24 Oct 2025 21:18:39 +0200 Subject: hyprctl: include color management presets and sdr information (#12019) * move string parsing for eCMType to its own namespace, similar to how `src/protocols/types/ContentType.cpp` is done * expose cm type and sdr settings in `hyprctl monitors`, format floats to .2f --- src/config/ConfigManager.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 151941fe..0e88fca3 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -2273,28 +2273,12 @@ bool CMonitorRuleParser::parseBitdepth(const std::string& value) { } bool CMonitorRuleParser::parseCM(const std::string& value) { - if (value == "auto") - m_rule.cmType = CM_AUTO; - else if (value == "srgb") - m_rule.cmType = CM_SRGB; - else if (value == "wide") - m_rule.cmType = CM_WIDE; - else if (value == "edid") - m_rule.cmType = CM_EDID; - else if (value == "hdr") - m_rule.cmType = CM_HDR; - else if (value == "hdredid") - m_rule.cmType = CM_HDR_EDID; - else if (value == "dcip3") - m_rule.cmType = CM_DCIP3; - else if (value == "dp3") - m_rule.cmType = CM_DP3; - else if (value == "adobe") - m_rule.cmType = CM_ADOBE; - else { + auto parsedCM = NCMType::fromString(value); + if (!parsedCM.has_value()) { m_error += "invalid cm "; return false; } + m_rule.cmType = parsedCM.value(); return true; } -- cgit v1.2.3