mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 14:42:01 -07:00
hyprctl: Make device configs queryable (#3226)
* Make device configs queryable Signed-off-by: pdamianik <39028343+pdamianik@users.noreply.github.com> * Add set property to getoption output --------- Signed-off-by: pdamianik <39028343+pdamianik@users.noreply.github.com>
This commit is contained in:
@@ -2015,20 +2015,36 @@ SConfigValue* CConfigManager::getConfigValuePtr(const std::string& val) {
|
||||
}
|
||||
|
||||
SConfigValue* CConfigManager::getConfigValuePtrSafe(const std::string& val) {
|
||||
const auto IT = configValues.find(val);
|
||||
if (val.starts_with("device:")) {
|
||||
const auto DEVICE = val.substr(7, val.find_last_of(':') - 7);
|
||||
const auto CONFIGVAR = val.substr(val.find_last_of(':') + 1);
|
||||
|
||||
if (IT == configValues.end()) {
|
||||
// maybe plugin
|
||||
const auto DEVICECONF = deviceConfigs.find(DEVICE);
|
||||
if (DEVICECONF == deviceConfigs.end())
|
||||
return nullptr;
|
||||
|
||||
const auto IT = DEVICECONF->second.find(CONFIGVAR);
|
||||
|
||||
if (IT == DEVICECONF->second.end())
|
||||
return nullptr;
|
||||
|
||||
return &IT->second;
|
||||
} else if (val.starts_with("plugin:")) {
|
||||
for (auto& [pl, pMap] : pluginConfigs) {
|
||||
const auto PLIT = pMap->find(val);
|
||||
const auto IT = pMap->find(val);
|
||||
|
||||
if (PLIT != pMap->end())
|
||||
return &PLIT->second;
|
||||
if (IT != pMap->end())
|
||||
return &IT->second;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const auto IT = configValues.find(val);
|
||||
|
||||
if (IT == configValues.end())
|
||||
return nullptr;
|
||||
|
||||
return &(IT->second);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user