From 828b1c050d527140299e4f0137240540b603b74b Mon Sep 17 00:00:00 2001 From: XargonWan Date: Fri, 21 Feb 2025 11:35:14 +0900 Subject: [PATCH] CLI: added OS info and moved --show-config out of the silent log zone --- functions/global.sh | 12 ++++++++---- retrodeck.sh | 13 +++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/functions/global.sh b/functions/global.sh index 4fc27e6d..f6f7066c 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -11,6 +11,7 @@ rd_logs_folder="/var/config/retrodeck/logs" # Static location to write all Retro source /app/libexec/logger.sh rotate_logs +# OS detection width=$(grep -oP '\d+(?=x)' /sys/class/graphics/fb0/modes) height=$(grep -oP '(?<=x)\d+' /sys/class/graphics/fb0/modes) if [[ $width -ne 1280 ]] || [[ $height -ne 800 ]]; then @@ -18,13 +19,17 @@ if [[ $width -ne 1280 ]] || [[ $height -ne 800 ]]; then else native_resolution=true fi +distro_name=$(flatpak-spawn --host grep '^ID=' /etc/os-release | cut -d'=' -f2) +distro_version=$(flatpak-spawn --host grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2) +gpu_info=$(flatpak-spawn --host lspci | grep -i 'vga\|3d\|2d') log d "Debug mode enabled" log i "Initializing RetroDECK" -log i "Running on $XDG_SESSION_DESKTOP, $XDG_SESSION_TYPE" +log i "Running on $XDG_SESSION_DESKTOP, $XDG_SESSION_TYPE, $distro_name $distro_version" if [[ -n $container ]]; then - log i "$container environment" + log i "Running inside $container environment" fi +log i "GPU: $gpu_info" log i "Resolution: $width x $height" if [[ $native_resolution == true ]]; then log i "Steam Deck native resolution detected" @@ -219,8 +224,7 @@ if [[ ! -f "$rd_conf" ]]; then # If the config file is existing i just read the variables else - log i "Found RetroDECK config file in $rd_conf" - log i "Loading it" + log i "Loading RetroDECK config file in $rd_conf" if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build set_setting_value $rd_conf "update_repo" "$cooker_repository_name" retrodeck "options" diff --git a/retrodeck.sh b/retrodeck.sh index 6dee7638..8b24fe3c 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -59,14 +59,6 @@ case "$1" in fi exit 0 ;; - --show-config) - LOG_SILENT=true - source /app/libexec/global.sh - echo "RetroDECK config file is in: $rd_conf" - echo "Contents:" - cat "$rd_conf" - exit 0 - ;; --set-help) LOG_SILENT=true source /app/libexec/global.sh @@ -100,6 +92,11 @@ while [[ $# -gt 0 ]]; do fi case "$1" in + --show-config) + echo "" + cat "$rd_conf" + exit 0 + ;; --debug) logging_level="debug" shift