Show the screensaver branding on the login screen
This commit is contained in:
1 parent
6c83f7089c
commit
93e1f1b05f
2 files changed
+44
-1
No files matched your search
@@ -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
|
||||
|
||||
+15
-1
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user