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
This commit is contained in:
Filip Mikina 2025-10-24 21:18:39 +02:00 committed by GitHub
parent 117e38db35
commit 34812c33db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 104 additions and 54 deletions

View file

@ -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;
}