The missing changes from this morning
This commit is contained in:
@@ -87,29 +87,42 @@ function load_profile_to_outputs {
|
||||
rotation=$(echo "$out" | jq -r '.rotation')
|
||||
scale=$(echo "$out" | jq -r '.scale')
|
||||
mode=$(echo "$out" | jq -r '.currentModeId')
|
||||
mode_name=$(echo "$out" | jq -r ".modes[] | select(.id == \"$mode\") | .name")
|
||||
log "[VAR]" $mode_name
|
||||
priority=$(echo "$out" | jq -r '.priority')
|
||||
|
||||
# Mode (Resolution + refresh)
|
||||
kscreen-doctor "output.$name.mode.$mode"
|
||||
# CMD="kscreen-doctor output.$name.mode.$mode"
|
||||
CMD="kscreen-doctor output.$name.mode.$mode_name"
|
||||
log "[CMD]" $CMD
|
||||
$CMD
|
||||
|
||||
# Position
|
||||
kscreen-doctor "output.$name.position.$posx,$posy"
|
||||
CMD="kscreen-doctor output.$name.position.$posx,$posy"
|
||||
log "[CMD]" $CMD
|
||||
$CMD
|
||||
|
||||
# Scale
|
||||
kscreen-doctor "output.$name.scale.$scale"
|
||||
CMD="kscreen-doctor output.$name.scale.$scale"
|
||||
log "[CMD]" $CMD
|
||||
$CMD
|
||||
|
||||
# Rotation (map from JSON names to kscreen-doctor options)
|
||||
CMD=""
|
||||
case "$rotation" in
|
||||
"1") kscreen-doctor "output.$name.rotation.normal" ;;
|
||||
"2") kscreen-doctor "output.$name.rotation.left" ;;
|
||||
"4") kscreen-doctor "output.$name.rotation.inverted" ;;
|
||||
"8") kscreen-doctor "output.$name.rotation.right" ;;
|
||||
"1") CMD="kscreen-doctor output.$name.rotation.normal" ;;
|
||||
"2") CMD="kscreen-doctor output.$name.rotation.left" ;;
|
||||
"4") CMD="kscreen-doctor output.$name.rotation.inverted" ;;
|
||||
"8") CMD="kscreen-doctor output.$name.rotation.right" ;;
|
||||
esac
|
||||
log "[CMD]" $CMD
|
||||
$CMD
|
||||
|
||||
# Primary / Not Primary
|
||||
echo $priority
|
||||
if [ $priority -eq 1 ]; then
|
||||
kscreen-doctor "output.$name.primary"
|
||||
CMD="kscreen-doctor output.$name.primary"
|
||||
log "[CMD]" $CMD
|
||||
$CMD
|
||||
fi
|
||||
|
||||
done <<< "$outputs"
|
||||
@@ -117,10 +130,6 @@ function load_profile_to_outputs {
|
||||
|
||||
load_profile_to_outputs "$outputs"
|
||||
|
||||
#########################
|
||||
# 2. Restore clone groups
|
||||
#########################
|
||||
|
||||
clone_groups=$(jq -c '.clones[]?' "$PROFILE")
|
||||
|
||||
function restore_clone_groups {
|
||||
@@ -130,7 +139,10 @@ function restore_clone_groups {
|
||||
others=$(echo "$clone" | jq -r '.[]' | tail -n +2)
|
||||
|
||||
for o in $others; do
|
||||
kscreen-doctor "output.$o.clone.$primary"
|
||||
CMD="kscreen-doctor output.$o.clone.$primary"
|
||||
log "[CMD]" $CMD
|
||||
$CMD
|
||||
|
||||
done
|
||||
done <<< "$clone_groups"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user