aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/user/test-userctl.sh
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-16 10:07:26 +0200
committerDanilo M. <danix@danix.xyz>2026-10-16 10:07:26 +0200
commit74de04faa4c51cf2a9442dcfe246dc04d1f8d19a (patch)
tree92f60698e5fef2a2cce528013f55f5767fe416d1 /desktop/modules/user/test-userctl.sh
parent147247a5aa30cae53c1152c4cc15226338def2f6 (diff)
downloadquickshell-74de04faa4c51cf2a9442dcfe246dc04d1f8d19a.tar.gz
quickshell-74de04faa4c51cf2a9442dcfe246dc04d1f8d19a.zip
fix(user): the avatar is ~/.user-icon.jpg, as hyprlock and SDDM use
The page showed AccountsService's icon, an older picture than the one the rest of the desktop uses: hyprlock, the udt SDDM theme (pointed at it by udt-accent) and the rofi power menu all read ~/.user-icon.jpg. get now prefers that file, and set converts the pick to JPEG there, through a temp file and a rename, before handing it to AccountsService so both agree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/user/test-userctl.sh')
-rwxr-xr-xdesktop/modules/user/test-userctl.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/desktop/modules/user/test-userctl.sh b/desktop/modules/user/test-userctl.sh
index 02a6e0c..33d50a2 100755
--- a/desktop/modules/user/test-userctl.sh
+++ b/desktop/modules/user/test-userctl.sh
@@ -34,11 +34,12 @@ case "$n" in
busctl) [[ " $* " == *" get-property "* ]] && printf '{"type":"s","data":"%s"}\n' "${@: -1}" ;;
git) [[ " $* " == *" --get "* ]] && { [[ -n "${GIT_VALUE:-}" ]] && echo "$GIT_VALUE" || exit 1; } ;;
gpg) cat "$GPG_FIXTURE" ;;
+ magick) : > "${@: -1}" ;;
esac
exit 0
EOF
chmod +x "$tmp/bin/stub"
-for n in busctl kwriteconfig6 git gpg; do ln -s stub "$tmp/bin/$n"; done
+for n in busctl kwriteconfig6 git gpg magick; do ln -s stub "$tmp/bin/$n"; done
export PATH="$tmp/bin:$PATH" HOME="$tmp" LOG="$tmp/log"
obj="/org/freedesktop/Accounts/User$(id -u)"
@@ -66,6 +67,11 @@ language=Language
location=Location
signingkey=ABCDEF" "$("$ctl" get)"
+# The desktop's avatar file, once it exists, wins over AccountsService's.
+: > "$HOME/.user-icon.jpg"
+check "get prefers ~/.user-icon.jpg" "avatar=$HOME/.user-icon.jpg" "$("$ctl" get | grep '^avatar=')"
+rm "$HOME/.user-icon.jpg"
+
# keys: the primary fingerprint and first uid of each secret key; subkey
# fingerprints and later uids are skipped.
reset
@@ -111,12 +117,21 @@ kwriteconfig6 [--file] [emaildefaults] [--group] [PROFILE_Default] [--key] [Emai
git [config] [--global] [user.email] [jane@example.org]" "$(cat "$LOG")"
# AccountsService only.
-for pair in avatar:SetIconFile language:SetLanguage location:SetLocation; do
+for pair in language:SetLanguage location:SetLocation; do
reset
"$ctl" set "${pair%%:*}" v >/dev/null
check "set ${pair%%:*} writes" "$acc [${pair#*:}] [s] [v]" "$(cat "$LOG")"
done
+# avatar: converted to ~/.user-icon.jpg through a temp file, then handed to
+# AccountsService, so the greeter, hyprlock and the login screen agree.
+reset
+"$ctl" set avatar /pics/me.png >/dev/null
+check "set avatar writes" "magick [/pics/me.png] [-auto-orient] [-strip] [$HOME/.user-icon.jpg.tmp.jpg]
+$acc [SetIconFile] [s] [$HOME/.user-icon.jpg]" "$(cat "$LOG")"
+check "set avatar leaves the file" "yes" "$([[ -e "$HOME/.user-icon.jpg" && ! -e "$HOME/.user-icon.jpg.tmp.jpg" ]] && echo yes)"
+rm -f "$HOME/.user-icon.jpg"
+
# signingkey: a fingerprint is written; empty unsets, but only if one is set.
reset
"$ctl" set signingkey ABCD >/dev/null