Add display identification overlays
This commit is contained in:
@@ -6,6 +6,9 @@ repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
component="$repo_dir/config/dot/quickshell/modules/settings/DisplayArrangement.qml"
|
||||
page="$repo_dir/config/dot/quickshell/modules/settings/DisplaysPage.qml"
|
||||
harness="$repo_dir/config/dot/quickshell/display-arrangement-harness.qml"
|
||||
identify="$repo_dir/config/dot/quickshell/modules/settings/DisplayIdentify.qml"
|
||||
service="$repo_dir/config/dot/quickshell/services/Displays.qml"
|
||||
shell="$repo_dir/config/dot/quickshell/shell.qml"
|
||||
|
||||
fail() {
|
||||
printf 'display arrangement contract: %s\n' "$1" >&2
|
||||
@@ -30,6 +33,22 @@ rg -Fq 'DisplayArrangement {' "$page" \
|
||||
|| fail 'Displays page does not expose the arrangement canvas'
|
||||
rg -Fq 'visible: Displays.monitors.length > 1' "$page" \
|
||||
|| fail 'arrangement is shown for a single display'
|
||||
[[ -f "$identify" ]] || fail 'DisplayIdentify.qml is missing'
|
||||
for contract in \
|
||||
'model: Quickshell.screens' \
|
||||
'WlrLayershell.keyboardFocus: WlrKeyboardFocus.None' \
|
||||
'mask: Region {}' \
|
||||
'visible: Displays.identifying' \
|
||||
'text: String(win.number)' \
|
||||
'text: win.connector'; do
|
||||
rg -Fq "$contract" "$identify" \
|
||||
|| fail "display identification overlay is incomplete: $contract"
|
||||
done
|
||||
rg -Fq 'DisplayIdentify {}' "$shell" \
|
||||
|| fail 'display identification overlays are not shell-owned'
|
||||
rg -Fq 'function identify()' "$service" \
|
||||
&& rg -Fq 'interval: 3000' "$service" \
|
||||
|| fail 'display identification does not use one three-second service timer'
|
||||
|
||||
state_home="$(mktemp -d /tmp/panama-display-arrangement-state.XXXXXX)"
|
||||
harness_pid=""
|
||||
@@ -82,4 +101,11 @@ jq -e '. == [
|
||||
]' <<<"$primary" >/dev/null \
|
||||
|| fail "Make primary did not normalize the selected output to 0,0: $primary"
|
||||
|
||||
ipc identify >/dev/null
|
||||
[[ "$(ipc identifying)" == "true" ]] \
|
||||
|| fail 'identify did not reveal the overlays'
|
||||
sleep 3.2
|
||||
[[ "$(ipc identifying)" == "false" ]] \
|
||||
|| fail 'identify overlays did not disappear after one three-second timer'
|
||||
|
||||
printf 'display arrangement contract: PASS\n'
|
||||
|
||||
Reference in New Issue
Block a user