Two of the panels this desktop still handed to GNOME Settings. Users manages the account through accountsservice -- the same daemon GNOME's panel drives, so a name or picture set here is what the login screen and lock screen read. Name, picture, account type, password, automatic login, and adding or removing other accounts. Every change is authorized by polkit through the agent this session already runs; a dismissed prompt is a normal outcome and says so. A new password is read from the helper's stdin, hashed by openssl reading its own stdin, and handed over D-Bus from inside that process. It is never an argument: argv is world-readable through /proc, so a password passed that way is published to every process on the machine. Removing an account takes two presses and says it destroys their files; the last administrator cannot be removed or demoted, because a machine nobody can administer is not a state to offer. Sharing reports what is actually true, including "the software for this is not installed" -- the honest answer for Samba here, and the case the panel it replaces shows as a switch that does nothing. Password sign-in is reported from sshd's configuration rather than assumed: claiming "keys only" when the file is silent would state a security property that cannot be backed up. The Control Center now draws the account's real picture and name. A generic glyph sat there while a real avatar was already set, which made the desktop look like it did not know whose it was. Also here: the KDE Connect contract no longer requires a phone to be awake. kdeconnectd drops its device objects for a phone it has not seen recently while the pairing survives in its config, so demanding one failed whenever the phone was off. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
42 lines
1.7 KiB
Bash
Executable File
42 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
fail() {
|
|
printf 'KDE Connect helper contract: %s\n' "$1" >&2
|
|
exit 1
|
|
}
|
|
|
|
project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
helper="$project_root/config/dot/quickshell/scripts/panama-kdeconnect"
|
|
|
|
[[ -x "$helper" ]] || fail 'helper is missing or not executable'
|
|
|
|
status="$($helper status)"
|
|
|
|
# The shape is checked whenever a device is present, but a device being present
|
|
# is not itself required. kdeconnectd drops its device objects for a phone it
|
|
# has not seen recently -- the pairing survives in its config, the D-Bus object
|
|
# does not -- so demanding one makes this fail whenever the phone is off, out of
|
|
# range, or simply has not opened the app today. That is the machine's state,
|
|
# not a defect in the helper.
|
|
jq -e '.available == true and (.devices | type == "array")' <<<"$status" >/dev/null \
|
|
|| fail 'live status is not a readable device list'
|
|
|
|
if [[ "$(jq -r '.devices | length' <<<"$status")" == "0" ]]; then
|
|
printf 'KDE Connect helper contract: PASS (no device visible to the daemon right now; shape checks skipped)\n'
|
|
exit 0
|
|
fi
|
|
|
|
jq -e '
|
|
([.devices[] | (keys | sort) == (["actions", "id", "name", "paired", "reachable", "type"] | sort)] | all) and
|
|
([.devices[] | (.id | test("^[A-Fa-f0-9]{32,64}$"))] | all) and
|
|
([.devices[].actions[] | . == "clipboard" or . == "ping" or . == "ring" or . == "share"] | all)
|
|
' <<<"$status" >/dev/null || fail 'live status shape is invalid'
|
|
|
|
paired_count="$(jq '[.devices[] | select(.paired)] | length' <<<"$status")"
|
|
reachable_count="$(jq '[.devices[] | select(.reachable)] | length' <<<"$status")"
|
|
printf 'KDE Connect helper contract: PASS (%s paired, %s reachable; identities redacted)\n' \
|
|
"$paired_count" \
|
|
"$reachable_count"
|