mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
CLI: added OS info and moved --show-config out of the silent log zone
This commit is contained in:
parent
9f092112ff
commit
828b1c050d
|
@ -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"
|
||||||
|
|
13
retrodeck.sh
13
retrodeck.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue