Bring the fingerprint affordance to the Quickshell lock screen and polkit dialog, matching what hyprlock did on master. Lock screen: render the md-fingerprint glyph inside the password field's right edge when a sensor is enrolled, reserving space so long passwords never run under it. Polkit dialog: show one method at a time. When a sensor is enrolled and the reader is reachable, the dialog is just the centered fingerprint icon (square card); the moment PAM asks for a password it switches to the password field. Detects pam_fprintd anywhere in the auth stack now that a gate can precede it. Lid awareness: a closed lid means the reader is unreachable, so both surfaces fall back to the password. polkit gets a pam_exec clamshell gate (auth [success=1 default=ignore] before pam_fprintd) so a shut lid drops straight to the password prompt instead of blocking on the reader for the pam_fprintd timeout; the lock screen hides the icon and skips scanning. The gate points at the fixed /usr/bin path the package always provides so it survives switching between package installs and dev-link. A migration adds the gate for existing fingerprint setups. New helper omarchy-hw-laptop-closed (pure lid state); omarchy-hw-clamshell now composes it with the external-monitor check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
72 lines
1.9 KiB
Bash
Executable File
72 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
|
|
|
|
TMPDIR=""
|
|
QS_PID=""
|
|
|
|
cleanup() {
|
|
if [[ -n $QS_PID ]] && kill -0 "$QS_PID" 2>/dev/null; then
|
|
kill "$QS_PID" 2>/dev/null || true
|
|
wait "$QS_PID" 2>/dev/null || true
|
|
fi
|
|
[[ -n $TMPDIR && -d $TMPDIR ]] && rm -rf "$TMPDIR"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
if [[ -z ${WAYLAND_DISPLAY:-} ]]; then
|
|
pass "no Wayland compositor; skipping lock fingerprint indicator test"
|
|
exit 0
|
|
fi
|
|
|
|
if ! command -v quickshell >/dev/null 2>&1; then
|
|
pass "quickshell not installed; skipping lock fingerprint indicator test"
|
|
exit 0
|
|
fi
|
|
|
|
require_command jq
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
result="$TMPDIR/result.json"
|
|
log="$TMPDIR/quickshell.log"
|
|
config_dir="$TMPDIR/lock-fingerprint-indicator"
|
|
mkdir -p "$config_dir" "$TMPDIR/home"
|
|
cp "$SHELL_TEST_DIR/fixtures/lock-fingerprint-indicator/shell.qml" "$config_dir/shell.qml"
|
|
ln -s "$ROOT/shell/Ui" "$config_dir/Ui"
|
|
ln -s "$ROOT/shell/Commons" "$config_dir/Commons"
|
|
|
|
OMARCHY_PATH="$ROOT" \
|
|
OMARCHY_QML_TEST_RESULT="$result" \
|
|
HOME="$TMPDIR/home" \
|
|
QML2_IMPORT_PATH="$ROOT/shell${QML2_IMPORT_PATH:+:$QML2_IMPORT_PATH}" \
|
|
QML_IMPORT_PATH="$ROOT/shell${QML_IMPORT_PATH:+:$QML_IMPORT_PATH}" \
|
|
PATH="$ROOT/bin:$PATH" \
|
|
quickshell -p "$config_dir" --no-color >"$log" 2>&1 &
|
|
QS_PID=$!
|
|
|
|
for _ in {1..80}; do
|
|
[[ -s $result ]] && break
|
|
if ! kill -0 "$QS_PID" 2>/dev/null; then
|
|
sed -n '1,220p' "$log" >&2
|
|
fail "lock fingerprint indicator quickshell exited before writing result"
|
|
fi
|
|
sleep 0.1
|
|
done
|
|
|
|
[[ -s $result ]] || {
|
|
sed -n '1,220p' "$log" >&2
|
|
fail "lock fingerprint indicator test timed out"
|
|
}
|
|
|
|
if ! jq -e '.ok == true' "$result" >/dev/null; then
|
|
printf 'Lock fingerprint indicator result:\n' >&2
|
|
jq . "$result" >&2
|
|
printf 'Lock fingerprint indicator log:\n' >&2
|
|
sed -n '1,220p' "$log" >&2
|
|
fail "fingerprint indicator tracks the configured sensor"
|
|
fi
|
|
|
|
pass "fingerprint indicator tracks the configured sensor"
|