diff options
Diffstat (limited to 'scripts/testing/lib')
| -rw-r--r-- | scripts/testing/lib/validation.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/testing/lib/validation.sh b/scripts/testing/lib/validation.sh index 3191c64..58f2174 100644 --- a/scripts/testing/lib/validation.sh +++ b/scripts/testing/lib/validation.sh @@ -502,6 +502,38 @@ validate_hyprland_socket() { fi } +validate_portal_dark_mode() { + step "Checking Settings portal returns dark mode" + + # Check portals.conf exists and uses gtk for Settings + local portals_conf="/home/cjennings/.config/xdg-desktop-portal/portals.conf" + if ! ssh_cmd "test -f $portals_conf"; then + validation_fail "portals.conf not found" + attribute_issue "xdg-desktop-portal portals.conf missing" "archsetup" + return 1 + fi + + local settings_backend=$(ssh_cmd "grep 'org.freedesktop.impl.portal.Settings' $portals_conf 2>/dev/null | cut -d= -f2") + if [ "$settings_backend" = "none" ]; then + validation_fail "Settings portal disabled (set to 'none')" + attribute_issue "Settings portal disabled in portals.conf" "archsetup" + return 1 + fi + + # Query the portal for color-scheme (requires portal services running) + # Returns "v v u 1" for dark mode (1 = prefer-dark) + local color_scheme=$(ssh_cmd "sudo -u cjennings busctl --user call org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings Read 'ss' 'org.freedesktop.appearance' 'color-scheme' 2>/dev/null | grep -o 'u [0-9]' | cut -d' ' -f2") + + if [ "$color_scheme" = "1" ]; then + validation_pass "Settings portal returns dark mode (color-scheme=1)" + elif [ -z "$color_scheme" ]; then + validation_warn "Could not query Settings portal (portal may not be running)" + else + validation_fail "Settings portal not returning dark mode (color-scheme=$color_scheme, expected 1)" + attribute_issue "Settings portal not configured for dark mode" "archsetup" + fi +} + validate_window_manager() { # Detect which desktop environment is installed and validate accordingly if ssh_cmd "pacman -Q hyprland &>/dev/null"; then @@ -509,6 +541,7 @@ validate_window_manager() { validate_hyprland_tools validate_hyprland_config validate_hyprland_socket + validate_portal_dark_mode elif ssh_cmd "test -f /usr/local/bin/dwm"; then section "DWM Desktop Environment" validate_suckless_tools |
