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