From 93e1f1b05f7a9c556d8248dea2cec866d4621354 Mon Sep 17 00:00:00 2001 From: SirBlob Date: Sun, 4 Oct 2026 02:24:47 -0400 Subject: [PATCH] Show the screensaver branding on the login screen --- default/sddm/blob/Main.qml | 29 +++++++++++++++++++++++++++++ install/steps/login.sh | 16 +++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/default/sddm/blob/Main.qml b/default/sddm/blob/Main.qml index 3b0dc58..bbf06be 100644 --- a/default/sddm/blob/Main.qml +++ b/default/sddm/blob/Main.qml @@ -23,6 +23,11 @@ Rectangle { readonly property int smallFontSize: 14 readonly property int sectionGap: 48 readonly property int edgeMargin: 32 + readonly property int brandingMaxWidth: 1100 + readonly property int brandingMaxFontSize: 36 + readonly property int brandingMinFontSize: 4 + + readonly property string brandingText: brandingLoader.item ? brandingLoader.item.text : "" property string username: userModel.lastUser property bool enteringUsername: username.length === 0 @@ -111,7 +116,31 @@ Rectangle { onClicked: fieldInput.forceActiveFocus() } + Loader { + id: brandingLoader + source: "Branding.qml" + } + + Text { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: clockColumn.top + anchors.bottomMargin: root.sectionGap + width: Math.min(parent.width * 0.86, root.brandingMaxWidth) + height: Math.max(0, clockColumn.y - root.sectionGap * 2) + visible: root.brandingText.length > 0 + text: root.brandingText + textFormat: Text.PlainText + color: root.textColor + font.family: root.fontFamily + font.pixelSize: root.brandingMaxFontSize + minimumPixelSize: root.brandingMinFontSize + fontSizeMode: Text.Fit + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignBottom + } + Image { + visible: root.brandingText.length === 0 anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: clockColumn.top anchors.bottomMargin: root.sectionGap diff --git a/install/steps/login.sh b/install/steps/login.sh index 7e8de24..8863c86 100644 --- a/install/steps/login.sh +++ b/install/steps/login.sh @@ -18,6 +18,7 @@ greeter_theme_files=(Main.qml metadata.desktop theme.conf) # the greeter with no compositor and the screen black. install_login_config() { install_greeter_theme + install_greeter_branding install_root_file "$repo_dir/default/sddm/hyprland-greeter.lua" \ "$greeter_compositor_config" "sddm/hyprland-greeter.lua" install_root_file "$repo_dir/default/sddm/zz-blob.conf" \ @@ -29,7 +30,7 @@ install_login_config() { } install_greeter_theme() { - local file + local file force=true for file in "${greeter_theme_files[@]}"; do install_root_file "$repo_dir/default/sddm/blob/$file" \ "$greeter_theme_dir/$file" "sddm/themes/blob/$file" @@ -38,6 +39,19 @@ install_greeter_theme() { "$greeter_theme_dir/logo.svg" "sddm/themes/blob/logo.svg" } +install_greeter_branding() { + local source="$HOME/.config/blob/branding/screensaver.txt" + [[ -r $source ]] || source="$repo_dir/branding/screensaver.txt" + [[ -r $source ]] && command -v jq >/dev/null || return 0 + + local generated force=true + generated="$(mktemp)" + printf 'import QtQuick\n\nQtObject {\n readonly property string text: %s\n}\n' \ + "$(jq -Rs . <"$source")" >"$generated" + install_root_file "$generated" "$greeter_theme_dir/Branding.qml" "sddm/themes/blob/Branding.qml" + rm -f "$generated" +} + install_session_entry() { install_root_file "$repo_dir/session/blob.desktop" \ "$session_entry_dir/blob.desktop" "wayland session entry"