From 0d1f64f2cb5ecf1d305293f22d6abdbee31e2ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tales=20A=2E=20Mendon=C3=A7a?= Date: Fri, 24 Jul 2026 14:34:01 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix:=20fix(gnome):=20restore?= =?UTF-8?q?=20accent=20colors=20in=20live=20session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reset portals activated by the live wizard before starting GNOME. Import the GNOME environment so the correct portal backend propagates accent colors to libadwaita apps. Add regression coverage for the portal reset. --- biglinux-livecd/usr/bin/startbiglive | 17 ++++++++++++ tests/test_livecd_security.py | 41 ++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/biglinux-livecd/usr/bin/startbiglive b/biglinux-livecd/usr/bin/startbiglive index 47613c1c..e1c7f095 100755 --- a/biglinux-livecd/usr/bin/startbiglive +++ b/biglinux-livecd/usr/bin/startbiglive @@ -642,6 +642,22 @@ if [[ -f "$installer_shortcut" ]]; then gio set "$installer_shortcut" metadata::trusted true 2>/dev/null || true fi +_reset_gnome_portals() { + # The wizard can activate the portal before the GNOME environment exists. + # Reset it so the desktop session selects the GNOME Settings backend. + dbus-update-activation-environment --systemd \ + DESKTOP_SESSION XDG_SESSION_DESKTOP GDMSESSION XDG_CURRENT_DESKTOP \ + 2>/dev/null || true + systemctl --user import-environment \ + DESKTOP_SESSION XDG_SESSION_DESKTOP GDMSESSION XDG_CURRENT_DESKTOP \ + 2>/dev/null || true + systemctl --user stop \ + xdg-desktop-portal.service \ + xdg-desktop-portal-gtk.service \ + xdg-desktop-portal-gnome.service \ + 2>/dev/null || true +} + # libadwaita apps use their own color-scheme setting and can ignore GTK INI files # in non-GNOME sessions. GNOME reads color-scheme from dconf directly, and the # forced override would fight the wizard's choice there, so skip it on gdm. @@ -675,6 +691,7 @@ elif [[ "$display_manager" == "gdm" ]]; then # GNOME: Clean up and start gnome-session rm -f "$HOME/Empty Bash" "$HOME/Empty Desktop File.desktop" "$HOME/Empty File" xdg-user-dirs-update + _reset_gnome_portals exec startgnome-community elif [[ -e /usr/share/wayland-sessions/hyprland.desktop ]]; then diff --git a/tests/test_livecd_security.py b/tests/test_livecd_security.py index a766036e..76744b0f 100644 --- a/tests/test_livecd_security.py +++ b/tests/test_livecd_security.py @@ -285,6 +285,47 @@ def test_startbiglive_defers_noncritical_work_until_after_wizard() -> None: assert wizard_launch < theme_sync +def test_startbiglive_resets_early_portals_before_gnome(tmp_path: Path) -> None: + source = STARTBIGLIVE.read_text(encoding="utf-8") + function_start = source.index("_reset_gnome_portals() {") + function_end = source.index("\n}\n", function_start) + 3 + function = source[function_start:function_end] + command_log = tmp_path / "commands" + result = run_bash( + f""" +dbus-update-activation-environment() {{ + printf 'dbus:%s\\n' "$*" >>"$COMMAND_LOG" +}} +systemctl() {{ + printf 'systemctl:%s\\n' "$*" >>"$COMMAND_LOG" +}} +{function} +_reset_gnome_portals +""", + environment={"COMMAND_LOG": str(command_log)}, + ) + assert result.returncode == 0, result.stderr + assert command_log.read_text(encoding="utf-8").splitlines() == [ + ( + "dbus:--systemd DESKTOP_SESSION XDG_SESSION_DESKTOP " + "GDMSESSION XDG_CURRENT_DESKTOP" + ), + ( + "systemctl:--user import-environment DESKTOP_SESSION " + "XDG_SESSION_DESKTOP GDMSESSION XDG_CURRENT_DESKTOP" + ), + ( + "systemctl:--user stop xdg-desktop-portal.service " + "xdg-desktop-portal-gtk.service " + "xdg-desktop-portal-gnome.service" + ), + ] + gnome_branch = source.index('elif [[ "$display_manager" == "gdm" ]]') + reset = source.index("_reset_gnome_portals", gnome_branch) + session = source.index("exec startgnome-community", gnome_branch) + assert reset < session + + def test_wizard_defers_noninitial_pages_and_accessibility_backends() -> None: app_window = ( PACKAGE / "usr/share/biglinux/livecd/ui/app_window.py" From d02e03a4e8291f6b71d64afa171436ea39d91e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tales=20A=2E=20Mendon=C3=A7a?= Date: Fri, 24 Jul 2026 14:57:30 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix:=20=E2=80=A2=20fix(livec?= =?UTF-8?q?d):=20set=20Fcitx=20keyboard=20profile=20for=20Plasma=20live=20?= =?UTF-8?q?sessions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plasma Wayland starts Fcitx during the live session, and Fcitx can keep the active input method on keyboard-us even when the wizard saved br and localectl was already updated. This made Portuguese layouts type as US, for example รง producing ;. Write a live Fcitx profile from /tmp/big_keyboard before starting the final KDE session, and keep it limited to SDDM/Plasma so GNOME, Cinnamon, and XFCE keep their existing keyboard paths unchanged. --- biglinux-livecd/usr/bin/startbiglive | 36 ++++++++++++++++++++++++++++ tests/test_livecd_keyboard.py | 7 ++++++ 2 files changed, 43 insertions(+) diff --git a/biglinux-livecd/usr/bin/startbiglive b/biglinux-livecd/usr/bin/startbiglive index e1c7f095..e511d228 100755 --- a/biglinux-livecd/usr/bin/startbiglive +++ b/biglinux-livecd/usr/bin/startbiglive @@ -38,6 +38,39 @@ _split_xkb_layout() { fi } +_fcitx5_keyboard_input_method() { + if [[ -n $2 ]]; then + printf 'keyboard-%s-%s\n' "$1" "$2" + else + printf 'keyboard-%s\n' "$1" + fi +} + +_configure_fcitx5_keyboard_profile() { + local layout=$1 variant=$2 input_method profile_directory + input_method=$(_fcitx5_keyboard_input_method "$layout" "$variant") + profile_directory=$HOME/.config/fcitx5 + mkdir -p -- "$profile_directory" + cat >"$profile_directory/profile" < None: result = run_bash( f""" _log() {{ :; }} +display_manager=sddm live_state_path() {{ printf '%s\\n' "$STATE_FILE"; }} setxkbmap() {{ printf 'setxkbmap:%s\\n' "$*" >>"$COMMAND_LOG"; }} sudo() {{ printf 'sudo:%s\\n' "$*" >>"$COMMAND_LOG"; }} @@ -105,6 +106,7 @@ def test_startbiglive_applies_saved_keyboard_layout(tmp_path: Path) -> None: assert result.returncode == 0, result.stderr kxkbrc = (home / ".config/kxkbrc").read_text(encoding="utf-8") + fcitx_profile = (home / ".config/fcitx5/profile").read_text(encoding="utf-8") commands = command_log.read_text(encoding="utf-8") assert "setxkbmap:us -variant intl\n" in commands assert ( @@ -113,3 +115,8 @@ def test_startbiglive_applies_saved_keyboard_layout(tmp_path: Path) -> None: ) assert "LayoutList=us\n" in kxkbrc assert "VariantList=intl\n" in kxkbrc + assert 'Name="Live Keyboard"\n' in fcitx_profile + assert "Default Layout=us\n" in fcitx_profile + assert "DefaultIM=keyboard-us-intl\n" in fcitx_profile + assert "Name=keyboard-us-intl\n" in fcitx_profile + assert '0="Live Keyboard"\n' in fcitx_profile