From 5c8f192b6e3fde2cdd35dbe7cd6c5f3f5c8e9d80 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 25 Sep 2026 18:43:26 +0200 Subject: feat(panel): draw the UDT avatar at the lock screen's size Read the login avatar from the `avatar` key udt-accent writes, the same ~/.user-icon.jpg hyprlock draws, when the entered username matches `avatarUser`. Any other user still gets their AccountsService icon. Shrink the avatar from 256px to 180px so greeter and lock match. Co-Authored-By: Claude Opus 5.5 --- theme/components/Panel.qml | 13 ++++++++++--- theme/theme.conf | 6 ++++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'theme') diff --git a/theme/components/Panel.qml b/theme/components/Panel.qml index 071f651..b0aa026 100644 --- a/theme/components/Panel.qml +++ b/theme/components/Panel.qml @@ -74,6 +74,13 @@ Item { : "?" function refreshAvatar() { + // udt-accent's avatar is the one hyprlock draws, so it wins for the + // user who generated it; everyone else keeps their AccountsService icon. + var own = config.stringValue("avatar") + if (own !== "" && creds.username === config.stringValue("avatarUser")) { + avatarPath = "file://" + own + return + } for (var i = 0; i < faces.count; ++i) { var it = faces.itemAt(i) if (it && it.faceName === creds.username) { @@ -129,8 +136,8 @@ Item { } Item { - width: 256 - height: 256 + width: 180 + height: 180 anchors.horizontalCenter: parent.horizontalCenter Rectangle { @@ -143,7 +150,7 @@ Item { text: panel.initials color: panel.textColor font.family: "Noto Sans" - font.pixelSize: 92 + font.pixelSize: 65 } } diff --git a/theme/theme.conf b/theme/theme.conf index 0388c34..24c647c 100644 --- a/theme/theme.conf +++ b/theme/theme.conf @@ -54,3 +54,9 @@ powerIcon= rebootIcon= suspendIcon= hibernateIcon= + +# Login avatar. udt-accent writes the path of ~/.user-icon.jpg and the user it +# belongs to, so the greeter shows what hyprlock shows. Empty, or any other +# username, falls back to the AccountsService icon. +avatar= +avatarUser= -- cgit v1.2.3