#!/usr/bin/env bash set -u export PATH=/usr/bin # Read-only compatibility report for the experimental Aquamarine native-5K # series documented at https://aquamarine.youens.com/. section() { printf '\n## %s\n' "$1" } value_or_unknown() { local value=${1:-} if [[ -n $value ]]; then printf '%s\n' "$value" else printf 'unknown\n' fi } package_line() { local package=${1:?package name required} if command -v pacman >/dev/null 2>&1; then pacman -Q "$package" 2>/dev/null || printf '%s not-installed\n' "$package" else printf '%s unknown-non-Arch-system\n' "$package" fi } printf '# Aquamarine native-5K preflight\n' printf 'generated=%s\n' "$(date --iso-8601=seconds 2>/dev/null || date)" printf 'mode=read-only\n' section 'System' if [[ -r /etc/os-release ]]; then # shellcheck disable=SC1091 . /etc/os-release printf 'distribution=%s\n' "${PRETTY_NAME:-${NAME:-unknown}}" else printf 'distribution=unknown\n' fi printf 'kernel=%s\n' "$(uname -srmo)" printf 'architecture=%s\n' "$(uname -m)" printf 'session_type=%s\n' "${XDG_SESSION_TYPE:-unknown}" printf 'desktop=%s\n' "${XDG_CURRENT_DESKTOP:-unknown}" account_passwd_entry=$(getent passwd "$UID" 2>/dev/null || true) account_user=$(awk -F: 'NR == 1 {print $1}' <<<"$account_passwd_entry") account_login_shell=$(awk -F: 'NR == 1 {print $7}' <<<"$account_passwd_entry") resolved_login_shell=$(readlink -f "$account_login_shell" 2>/dev/null || true) guided_bash_login_shell=no [[ $resolved_login_shell != /usr/bin/bash ]] || guided_bash_login_shell=yes printf 'account_user=%s\n' "${account_user:-unknown}" printf 'account_login_shell=%s\n' "${account_login_shell:-unknown}" printf 'resolved_login_shell=%s\n' "${resolved_login_shell:-unknown}" printf 'guided_bash_login_shell=%s\n' "$guided_bash_login_shell" display_manager=$(basename "$(readlink -f /etc/systemd/system/display-manager.service 2>/dev/null || true)") printf 'display_manager=%s\n' "${display_manager:-unknown}" section 'SDDM login behavior' sddm_autologin_user= sddm_autologin_session= sddm_autologin_relogin=false sddm_config_files=() sddm_unreadable_files=() shopt -s nullglob for directory in /usr/lib/sddm/sddm.conf.d /etc/sddm.conf.d; do [[ -d $directory ]] || continue if [[ ! -r $directory || ! -x $directory ]]; then sddm_unreadable_files+=("$directory/") continue fi for file in "$directory"/*; do [[ -f $file ]] || continue if [[ -r $file ]]; then sddm_config_files+=("$file") else sddm_unreadable_files+=("$file") fi done done if [[ -f /etc/sddm.conf ]]; then if [[ -r /etc/sddm.conf ]]; then sddm_config_files+=(/etc/sddm.conf) else sddm_unreadable_files+=(/etc/sddm.conf) fi fi if (( ${#sddm_config_files[@]} > 0 )); then mapfile -t sddm_values < <(awk ' function trim(value) { sub(/^[[:space:]]+/, "", value) sub(/[[:space:]]+$/, "", value) return value } FNR == 1 { section = "General" } { line = $0 sub(/\r$/, "", line) sub(/#.*/, "", line) line = trim(line) equals = index(line, "=") if (equals > 0) { key = trim(substr(line, 1, equals - 1)) value = trim(substr(line, equals + 1)) if (section == "Autologin" && key == "User") { user = value user_source = FILENAME } else if (section == "Autologin" && key == "Session") { session = value session_source = FILENAME } else if (section == "Autologin" && key == "Relogin") { relogin = (tolower(value) == "true" ? "true" : "false") relogin_source = FILENAME } } else if (line ~ /^\[.*\]$/) { section = substr(line, 2, length(line) - 2) } } END { if (relogin == "") relogin = "false" print user print session print relogin print user_source print session_source print relogin_source } ' "${sddm_config_files[@]}") sddm_autologin_user=${sddm_values[0]:-} sddm_autologin_session=${sddm_values[1]:-} sddm_autologin_relogin=${sddm_values[2]:-false} sddm_autologin_user_source=${sddm_values[3]:-} sddm_autologin_session_source=${sddm_values[4]:-} sddm_autologin_relogin_source=${sddm_values[5]:-} fi sddm_autologin_configured=no if [[ -n $sddm_autologin_user ]]; then sddm_autologin_configured=yes fi sddm_relogin_blocks_manual_selection=no if [[ $sddm_autologin_configured == yes && $sddm_autologin_relogin == true ]]; then sddm_relogin_blocks_manual_selection=yes fi sddm_autologin_process=no sddm_autologin_process_user=unset sddm_autologin_process_for_user=no sddm_helper_state_unknown=no while IFS= read -r helper_pid; do if [[ ! -r /proc/$helper_pid/cmdline ]]; then sddm_helper_state_unknown=yes continue fi if ! mapfile -d '' -t helper_args <"/proc/$helper_pid/cmdline"; then sddm_helper_state_unknown=yes continue fi helper_autologin=no helper_user= for (( argument_index = 0; argument_index < ${#helper_args[@]}; ++argument_index )); do [[ ${helper_args[$argument_index]} != --autologin ]] || helper_autologin=yes if [[ ${helper_args[$argument_index]} == --user && $((argument_index + 1)) -lt ${#helper_args[@]} ]]; then helper_user=${helper_args[$((argument_index + 1))]} fi done if [[ $helper_autologin == yes ]]; then sddm_autologin_process=yes sddm_autologin_process_user=${helper_user:-unknown} [[ $helper_user != "$account_user" ]] || sddm_autologin_process_for_user=yes fi done < <(pgrep -x sddm-helper 2>/dev/null || true) sddm_manual_selection_safe=no if (( ${#sddm_unreadable_files[@]} > 0 )); then sddm_config_readable=no else sddm_config_readable=yes fi if [[ $sddm_config_readable == yes && $sddm_helper_state_unknown == no && $sddm_autologin_configured == no && $sddm_autologin_process == no ]]; then sddm_manual_selection_safe=yes elif [[ $sddm_config_readable == yes && $sddm_autologin_configured == yes && $sddm_helper_state_unknown == no && $sddm_autologin_user == "$account_user" && $sddm_autologin_relogin == false && $(basename "$sddm_autologin_session") == omarchy.desktop && $sddm_autologin_process_for_user == yes ]]; then sddm_manual_selection_safe=yes fi printf 'sddm_autologin_configured=%s\n' "$sddm_autologin_configured" printf 'sddm_autologin_user=%s\n' "${sddm_autologin_user:-unset}" printf 'sddm_autologin_session=%s\n' "${sddm_autologin_session:-unset}" printf 'sddm_autologin_relogin=%s\n' "${sddm_autologin_relogin:-unknown}" printf 'sddm_autologin_user_source=%s\n' "${sddm_autologin_user_source:-unset}" printf 'sddm_autologin_session_source=%s\n' "${sddm_autologin_session_source:-unset}" printf 'sddm_autologin_relogin_source=%s\n' "${sddm_autologin_relogin_source:-default-false}" printf 'sddm_autologin_process=%s\n' "$sddm_autologin_process" printf 'sddm_autologin_process_user=%s\n' "$sddm_autologin_process_user" printf 'sddm_autologin_process_for_user=%s\n' "$sddm_autologin_process_for_user" printf 'sddm_helper_state_unknown=%s\n' "$sddm_helper_state_unknown" printf 'sddm_config_readable=%s\n' "$sddm_config_readable" for unreadable_file in "${sddm_unreadable_files[@]}"; do printf 'sddm_unreadable_config=%s\n' "$unreadable_file" done printf 'sddm_relogin_blocks_manual_selection=%s\n' "$sddm_relogin_blocks_manual_selection" printf 'sddm_manual_selection_safe=%s\n' "$sddm_manual_selection_safe" section 'Packages' package_line omarchy package_line hyprland package_line aquamarine package_line uwsm package_line linux package_line base-devel package_line sddm package_line v4l-utils section 'Hyprland and Aquamarine ABI' if [[ -x /usr/bin/Hyprland ]]; then /usr/bin/Hyprland --version 2>/dev/null | sed -n '1,8p' || true printf 'inherited_LD_LIBRARY_PATH=%s\n' "${LD_LIBRARY_PATH:-unset}" printf 'linked_aquamarine_inherited=' ldd /usr/bin/Hyprland 2>/dev/null | awk '/libaquamarine\.so/ {print; found=1} END {if (!found) print "not-found"}' printf 'linked_aquamarine_clean=' env -u LD_LIBRARY_PATH -u LD_PRELOAD -u LD_AUDIT ldd /usr/bin/Hyprland 2>/dev/null | awk '/libaquamarine\.so/ {print; found=1} END {if (!found) print "not-found"}' else printf 'Hyprland=/usr/bin/Hyprland-not-found\n' fi hyprland_pids=$(pgrep -u "$UID" -x Hyprland 2>/dev/null || true) if [[ -n $hyprland_pids ]]; then while IFS= read -r hyprland_pid; do [[ -n $hyprland_pid ]] || continue printf 'active_hyprland_pid=%s\n' "$hyprland_pid" if [[ -r /proc/$hyprland_pid/maps ]]; then mapped_aquamarine=$(awk '/libaquamarine\.so/ {print $6}' "/proc/$hyprland_pid/maps" | sort -u | paste -sd, -) printf 'active_mapped_aquamarine=%s\n' "${mapped_aquamarine:-not-found}" else printf 'active_mapped_aquamarine=maps-not-readable\n' fi done <<<"$hyprland_pids" else printf 'active_hyprland_pid=not-running\n' printf 'active_mapped_aquamarine=not-running\n' fi section 'Inherited display overrides' for variable in \ LD_LIBRARY_PATH LD_PRELOAD LD_AUDIT BASH_ENV ENV OMARCHY_PATH \ AQ_DRM_TILED_STARTUP AQ_DRM_DEVICES WLR_DRM_DEVICES DRI_PRIME \ GBM_BACKEND __GLX_VENDOR_LIBRARY_NAME VK_ICD_FILENAMES; do if [[ -v $variable ]]; then printf '%s=%s\n' "$variable" "${!variable}" else printf '%s=unset\n' "$variable" fi done section 'GPU and driver' if command -v lspci >/dev/null 2>&1; then lspci -nnk 2>/dev/null | grep -E -i -A3 \ 'VGA compatible controller|Display controller|3D controller' || true else printf 'lspci=not-installed\n' fi section 'Connected DisplayPort connectors' shopt -s nullglob connected_total=0 for connector in /sys/class/drm/card*-*; do [[ -r $connector/status ]] || continue [[ $(<"$connector/status") == connected ]] || continue connected_total=$((connected_total + 1)) done connected=0 tiled=0 connected_dp_card= connected_dp_same_card=yes for connector in /sys/class/drm/card*-DP-*; do [[ -r $connector/status ]] || continue status=$(<"$connector/status") [[ $status == connected ]] || continue connected=$((connected + 1)) printf '\nconnector=%s\n' "$(basename "$connector")" connector_name=$(basename "$connector") this_drm_card=${connector_name%%-*} printf 'drm_card=%s\n' "$this_drm_card" if [[ -z $connected_dp_card ]]; then connected_dp_card=$this_drm_card elif [[ $this_drm_card != "$connected_dp_card" ]]; then connected_dp_same_card=no fi printf 'modes=' if [[ -r $connector/modes ]]; then paste -sd, "$connector/modes" else printf 'unavailable\n' fi if [[ -r $connector/edid ]] && [[ $(wc -c <"$connector/edid" 2>/dev/null || printf 0) -gt 0 ]]; then printf 'edid_sha256=%s\n' "$(sha256sum "$connector/edid" | awk '{print $1}')" if command -v edid-decode >/dev/null 2>&1; then tile_text=$(edid-decode "$connector/edid" 2>/dev/null | grep -E \ 'Tiled Display Topology|Num horizontal tiles|Tile location|Tile resolution|Tiled Display (Manufacturer|Product|Serial)' || true) if [[ -n $tile_text ]]; then tiled=$((tiled + 1)) printf '%s\n' "$tile_text" | sed 's/^[[:space:]]*/tile: /' else printf 'tile=not-reported\n' fi else printf 'tile=edid-decode-not-installed\n' fi else printf 'edid=missing-or-empty\n' fi done printf '\nconnected_drm_connectors_total=%s\n' "$connected_total" printf '\nconnected_dp_connectors=%s\n' "$connected" printf 'connectors_reporting_tile_data=%s\n' "$tiled" proven_gpu=no if [[ $connected == 2 && $connected_dp_same_card == yes && -n $connected_dp_card && -r /sys/class/drm/$connected_dp_card/device/vendor && -r /sys/class/drm/$connected_dp_card/device/device ]]; then connected_drm_driver=$(basename "$(readlink -f "/sys/class/drm/$connected_dp_card/device/driver" 2>/dev/null || true)") connected_gpu_vendor=$(<"/sys/class/drm/$connected_dp_card/device/vendor") connected_gpu_device=$(<"/sys/class/drm/$connected_dp_card/device/device") if [[ $connected_drm_driver == amdgpu && $connected_gpu_vendor == 0x1002 && $connected_gpu_device == 0x1900 ]]; then proven_gpu=yes fi printf 'connected_drm_driver=%s\n' "${connected_drm_driver:-unknown}" printf 'connected_gpu_pci_id=%s:%s\n' "${connected_gpu_vendor:-unknown}" "${connected_gpu_device:-unknown}" else printf 'connected_drm_driver=unknown\n' printf 'connected_gpu_pci_id=unknown\n' fi printf 'proven_radeon_780m_path=%s\n' "$proven_gpu" section 'Kernel DRM TILE properties' drm_tiled=0 if command -v modetest >/dev/null 2>&1; then for card in /dev/dri/card*; do [[ -e $card ]] || continue card_name=$(basename "$card") driver_path=$(readlink -f "/sys/class/drm/$card_name/device/driver" 2>/dev/null || true) driver=$(basename "$driver_path") [[ -n $driver && $driver != . ]] || continue while IFS='|' read -r tile_card tile_connector tile_hex; do [[ -n $tile_hex ]] || continue drm_tiled=$((drm_tiled + 1)) if command -v xxd >/dev/null 2>&1; then tile_value=$(printf '%s' "$tile_hex" | xxd -r -p 2>/dev/null | tr -d '\000') printf 'drm_tile=%s/%s %s\n' "$tile_card" "$tile_connector" "$tile_value" else printf 'drm_tile_hex=%s/%s %s\n' "$tile_card" "$tile_connector" "$tile_hex" fi done < <( timeout 8 modetest -M "$driver" -D "$card" -c 2>/dev/null | awk -v card="$card_name" ' function flush() { if (connector != "" && hex != "") print card "|" connector "|" hex hex = "" reading = 0 in_tile = 0 } /^[0-9]+[[:space:]]+[0-9]+[[:space:]]+(connected|disconnected)/ { flush() connector = ($3 == "connected") ? $4 : "" next } connector != "" && /^[[:space:]]+[0-9]+ TILE:/ { flush() in_tile = 1 next } in_tile && /^[[:space:]]+value:/ { reading = 1 next } reading && /^[[:space:]]+[[:xdigit:]]+[[:space:]]*$/ { line = $0 gsub(/[[:space:]]/, "", line) hex = hex line next } reading { flush() } END { flush() } ' ) done printf 'connectors_with_drm_tile_property=%s\n' "$drm_tiled" else printf 'modetest=not-installed\n' fi section 'Current compositor view' current_native5k=unknown current_enabled=unknown if command -v hyprctl >/dev/null 2>&1; then if command -v jq >/dev/null 2>&1; then monitor_json=$(hyprctl -j monitors all 2>/dev/null || true) if jq -e 'type == "array"' >/dev/null 2>&1 <<<"$monitor_json"; then jq -r '.[] | "monitor=\(.name) \(.width)x\(.height)@\(.refreshRate) scale=\(.scale) disabled=\(.disabled) description=\(.description)"' <<<"$monitor_json" current_enabled=$(jq '[.[] | select(.disabled == false)] | length' <<<"$monitor_json") current_native5k=$(jq '[.[] | select(.disabled == false and .width == 5120 and .height == 2880 and .refreshRate >= 59 and .refreshRate <= 61)] | length' <<<"$monitor_json") else printf 'hyprctl=not-ready\n' fi else hyprctl monitors all 2>/dev/null | sed -n '1,120p' || printf 'hyprctl=not-ready\n' fi else printf 'hyprctl=not-installed\n' fi printf 'enabled_monitor_count=%s\n' "$current_enabled" printf 'enabled_5120x2880_near_60hz_count=%s\n' "$current_native5k" section 'Known test matrix' expected=yes [[ $(uname -m) == x86_64 ]] || expected=no if command -v pacman >/dev/null 2>&1; then [[ $(pacman -Q omarchy 2>/dev/null || true) == 'omarchy 4.0.1-1' ]] || expected=no [[ $(pacman -Q hyprland 2>/dev/null || true) == 'hyprland 0.56.2-1' ]] || expected=no [[ $(pacman -Q aquamarine 2>/dev/null || true) == 'aquamarine 0.14.0-2' ]] || expected=no [[ $(pacman -Q uwsm 2>/dev/null || true) == 'uwsm 0.26.7-1' ]] || expected=no [[ $(pacman -Q linux 2>/dev/null || true) == 'linux 7.1.9.arch1-2' ]] || expected=no [[ $(pacman -Q base-devel 2>/dev/null || true) == 'base-devel 1-2' ]] || expected=no [[ $(pacman -Q sddm 2>/dev/null || true) == 'sddm 0.21.0-7' ]] || expected=no [[ $(pacman -Q v4l-utils 2>/dev/null || true) == 'v4l-utils 1.32.0-2' ]] || expected=no [[ $(uname -r) == '7.1.9-arch1-2' ]] || expected=no else expected=no fi printf 'exact_package_matrix=%s\n' "$expected" printf 'matrix_kind=current-guided-build-not-original-hardware-proof\n' printf 'required_topology=one-complete-2x1-tile-group-on-one-DRM-device\n' printf 'proven_hardware=LG-27MD5KA-plus-Radeon-780M\n' stock_session=no for stock_candidate in \ /usr/share/wayland-sessions/omarchy.desktop \ /usr/local/share/wayland-sessions/omarchy.desktop; do [[ -r $stock_candidate ]] || continue stock_session=yes printf 'stock_session=%s\n' "$stock_candidate" break done [[ $stock_session == yes ]] || printf 'stock_session=not-found\n' section 'Interpretation' if [[ $current_native5k =~ ^[0-9]+$ ]] && (( current_native5k > 0 )); then printf 'result=already-native-5k-stop\n' printf 'next=Hyprland already advertises an enabled 5120x2880 output near 60 Hz. Do not apply another build blindly; first identify the library and configuration already providing it.\n' elif [[ $current_native5k == 0 && $expected == yes && $guided_bash_login_shell == yes && $display_manager == sddm.service && $stock_session == yes && $connected_total == 2 && $connected == 2 && $drm_tiled == 2 && $proven_gpu == yes && $sddm_manual_selection_safe != yes ]]; then printf 'result=autologin-agent-required-stop\n' printf 'next=The effective SDDM state does not guarantee a one-time return to the manual chooser. Never point autologin at the candidate; have an experienced agent prepare a transactional disable and exact restoration plan, with backups outside every sddm.conf.d directory.\n' elif [[ $current_native5k == 0 && $expected == yes && $guided_bash_login_shell == yes && $display_manager == sddm.service && $stock_session == yes && $connected_total == 2 && $connected == 2 && $drm_tiled == 2 && $proven_gpu == yes && $sddm_manual_selection_safe == yes ]]; then printf 'result=needs-expert-topology-review\n' printf 'next=The coarse gates match, but this script does not prove group identity, completeness, mode symmetry, atomic scanout, or recovery. Have an experienced agent verify those before activation.\n' else printf 'result=not-confirmed\n' printf 'next=Do not force the experimental series. Compare this report with the compatibility gates on https://aquamarine.youens.com/.\n' fi printf 'warning=Startup native 5K is the only proven feature. The recommended cut has no grouped DPMS or Night Light/CTM support; hotplug, VT switching, and suspend are unproven.\n'