still working on refactoring things

This commit is contained in:
2025-12-07 16:18:01 -07:00
parent e92be07078
commit b25cb6b278

View File

@@ -79,15 +79,20 @@ function apply_attribute {
value=$3 value=$3
value_map=$4 value_map=$4
if [ $value != "null" ]; then
if [[ -n "$value_map" ]]; then if [[ -n "$value_map" ]]; then
value=${map["$value"]} log "[PREVALUE] Value supplied for $output_id $attribute: $value"
value=${value_map["$value"]}
log "[POSTVALUE] Value output for $output_id $attribute: $value"
fi fi
if [ $value != "null" ]; then
CMD="kscreen-doctor output.$output_id.$attribute.$value" CMD="kscreen-doctor output.$output_id.$attribute.$value"
fi log "[CMD]" $CMD
log "[CMDDDDDD]" $CMD
$CMD $CMD
else
log "Output $output_id has not attribute $attribute, skipping..."
fi
} }
function load_profile_to_outputs { function load_profile_to_outputs {
@@ -126,27 +131,21 @@ function load_profile_to_outputs {
declare -A bool_enable_map declare -A bool_enable_map
wcg_map["true"]="enable" bool_enable_map["true"]="enable"
wcg_map["false"]="false" bool_enable_map["false"]="disable"
declare -A rgb_range_map
rgb_range_map["0"]="automatic"
rgb_range_map["full"]="full"
rgb_range_map["limited"]="limited"
apply_attribute $name "wcg" $wcg $bool_enable_map apply_attribute $name "wcg" $wcg $bool_enable_map
#if [ $wcg == true ]; then
# CMD="kscreen-doctor output.$name.wcg.enable"
#else
# CMD="kscreen-doctor output.$name.wcg.disable"
#fi
#log "[CMD]" $CMD
#$CMD
if [ $sdrbrightness != "null" ]; then apply_attribute $name "sdr-brightness" $sdrbrightness
CMD="kscreen-doctor output.$name.sdr-brightness.${sdrbrightness}"
log "[CMD]" $CMD
$CMD
fi
apply_attribute $name "vrrpolicy" $vrrPolicy apply_attribute $name "vrrpolicy" $vrrPolicy
apply_attribute $name rgbrange $rgbRange apply_attribute $name "rgbrange" $rgbRange $rgb_range_map
CMD="kscreen-doctor output.$name.overscan.$overscan" CMD="kscreen-doctor output.$name.overscan.$overscan"
log "[CMD]" $CMD log "[CMD]" $CMD