CLI: added OS info and moved --show-config out of the silent log zone
Some checks are pending
Build RetroDECK / Build_RetroDECK (push) Waiting to run
Build RetroDECK / GitHub-publish (push) Blocked by required conditions
Build RetroDECK / Automated_Tests (push) Blocked by required conditions

This commit is contained in:
XargonWan 2025-02-21 11:35:14 +09:00
parent 9f092112ff
commit 828b1c050d
2 changed files with 13 additions and 12 deletions

View file

@ -11,6 +11,7 @@ rd_logs_folder="/var/config/retrodeck/logs" # Static location to write all Retro
source /app/libexec/logger.sh source /app/libexec/logger.sh
rotate_logs rotate_logs
# OS detection
width=$(grep -oP '\d+(?=x)' /sys/class/graphics/fb0/modes) width=$(grep -oP '\d+(?=x)' /sys/class/graphics/fb0/modes)
height=$(grep -oP '(?<=x)\d+' /sys/class/graphics/fb0/modes) height=$(grep -oP '(?<=x)\d+' /sys/class/graphics/fb0/modes)
if [[ $width -ne 1280 ]] || [[ $height -ne 800 ]]; then if [[ $width -ne 1280 ]] || [[ $height -ne 800 ]]; then
@ -18,13 +19,17 @@ if [[ $width -ne 1280 ]] || [[ $height -ne 800 ]]; then
else else
native_resolution=true native_resolution=true
fi 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 d "Debug mode enabled"
log i "Initializing RetroDECK" 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 if [[ -n $container ]]; then
log i "$container environment" log i "Running inside $container environment"
fi fi
log i "GPU: $gpu_info"
log i "Resolution: $width x $height" log i "Resolution: $width x $height"
if [[ $native_resolution == true ]]; then if [[ $native_resolution == true ]]; then
log i "Steam Deck native resolution detected" 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 # If the config file is existing i just read the variables
else else
log i "Found RetroDECK config file in $rd_conf" log i "Loading RetroDECK config file in $rd_conf"
log i "Loading it"
if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build 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" set_setting_value $rd_conf "update_repo" "$cooker_repository_name" retrodeck "options"

View file

@ -59,14 +59,6 @@ case "$1" in
fi fi
exit 0 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) --set-help)
LOG_SILENT=true LOG_SILENT=true
source /app/libexec/global.sh source /app/libexec/global.sh
@ -100,6 +92,11 @@ while [[ $# -gt 0 ]]; do
fi fi
case "$1" in case "$1" in
--show-config)
echo ""
cat "$rd_conf"
exit 0
;;
--debug) --debug)
logging_level="debug" logging_level="debug"
shift shift