From 9cbdc2ac9ef79354366661808b42f0e484aa42f7 Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Fri, 10 Jan 2025 22:20:58 -0300 Subject: [PATCH] fix: add gsettings fallback for MOTD (#110) --- ublue/motd/src/ublue-motd | 5 +++++ ublue/motd/ublue-motd.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ublue/motd/src/ublue-motd b/ublue/motd/src/ublue-motd index 8e83e83..1830e06 100755 --- a/ublue/motd/src/ublue-motd +++ b/ublue/motd/src/ublue-motd @@ -56,6 +56,11 @@ KEY_WARN_ESCAPED=$(escape "$KEY_WARN") THEME=$(dconf read /org/gnome/desktop/interface/accent-color 2>/dev/null || printf '%s' "\'$DEFAULT_THEME\'") +# Dconf will fail if the accent-color has not been changed yet +if [ "$THEME" == "" ] ; then + # Gsettings will not update if the system's schemas have not been configured properly + THEME=$(gsettings get org.gnome.desktop.interface accent-color 2>/dev/null || printf '%s' "\'$DEFAULT_THEME\'") +fi THEME=${THEME//\'/} THEME=${MOTD_FORCE_THEME:-$THEME} diff --git a/ublue/motd/ublue-motd.spec b/ublue/motd/ublue-motd.spec index 872a7f7..fec1b5b 100644 --- a/ublue/motd/ublue-motd.spec +++ b/ublue/motd/ublue-motd.spec @@ -1,7 +1,7 @@ %global debug_package %{nil} Name: ublue-motd -Version: 0.2.0 +Version: 0.2.1 Release: 1%{?dist} Summary: MOTD scripts for Universal Blue images