Skip to content
Snippets Groups Projects
Commit f175a0ba authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

weston:config: Added comments to rotation service

BCS 746-001371
parent 8b3b863b
No related branches found
No related tags found
1 merge request!600weston:config: Added service that checks the transform of the config
#!/usr/bin/awk -f
# The script checks or sets the transform value in the weston.ini. It does so by
# processing line by line, searching for config blocks. Each block starts with
# a [...]. In check mode, the script exits with either 0 (transform fits the
# fbcon rotation) or with 2, if the value differs from the fbcon rotation.
# In set mode, the process_block function prints the blocks to stdout and
# replaces the transform for the primary display with the correct value.
function process_block() {
if (todo == "check") {
if (found == 1 && block ~ "transform=" target_value)
......@@ -13,6 +20,7 @@ function process_block() {
}
}
# Initialize the script from the ENV parameters
BEGIN {
todo = ENVIRON["AWK_TODO"]
target_value = ENVIRON["AWK_TARGET_VALUE"]
......@@ -25,12 +33,16 @@ BEGIN {
first_line = 1
}
# If a new block in the weston.ini starts, process the
# current block and reset the runtime values
/^\[/ {
process_block()
block = ""
found = 0
}
# Append every line to the current block value and check
# if the block is the config of the primary output
{
if (first_line == 1) {
first_line=0
......@@ -43,6 +55,9 @@ BEGIN {
found = 1
}
# Process the last block and return the check exit
# value if the transform doesn't match the fbcon
# rotation
END {
block = block ORS
process_block()
......
#!/bin/sh
# Checks the current transform value of the primary display (DPI-1 or LVDS-1),
# compares it to the fbcon rotation, and sets the correct transform if the
# rotation in the weston.ini differs from the value of the fbcon rotation.
INI_PATH="/etc/xdg/weston/weston.ini"
ROTATION_FB="0"
ROTATION_WESTON="normal"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment