diff --git a/dzgui.sh b/dzgui.sh index f483d1e..680a355 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -13,7 +13,7 @@ sd_res="--width=1280 --height=800" steamsafe_zenity="/usr/bin/zenity" zenity_flags=("--width=500" "--title=DZGUI") declare -A deps -deps=([awk]="5.1.1" [curl]="7.80.0" [jq]="1.6" [tr]="9.0" [$steamsafe_zenity]="3.42.1") +deps=([awk]="5.1.1" [curl]="7.80.0" [jq]="1.6" [tr]="9.0" [$steamsafe_zenity]="3.44.1") #CONFIG config_path="$HOME/.config/dztui" @@ -65,6 +65,7 @@ km_helper_url="$releases_url/latlon" geo_file_url="$releases_url/ips.csv.gz" set_im_module(){ + #TODO: drop pending SteamOS changes pgrep -a gamescope | grep -q "generate-drm-mode" if [[ $? -eq 0 ]]; then GTK_IM_MODULE="" @@ -377,18 +378,20 @@ test_display_mode(){ fi } check_architecture(){ - local cpu=$(< /proc/cpuinfo grep "AMD Custom APU 0405") - if [[ -n "$cpu" ]]; then - if [[ $(test_display_mode) == "gm" ]]; then - is_steam_deck=2 - else - is_steam_deck=1 - fi - logger INFO "Setting architecture to 'Steam Deck'" - else + local cpu=$(< /proc/cpuinfo awk -F": " '/AMD Custom APU [0-9]{4}$/ {print $2; exit}') + read -a APU_MODEL <<< "$cpu" + if [[ ${APU_MODEL[3]} != "0932" ]] || [[ ${APU_MODEL[3]} != "0405" ]]; then is_steam_deck=0 logger INFO "Setting architecture to 'desktop'" + return fi + + if [[ $(test_display_mode) == "gm" ]]; then + is_steam_deck=2 + else + is_steam_deck=1 + fi + logger INFO "Setting architecture to 'Steam Deck'" } check_map_count(){ [[ $is_steam_deck -gt 0 ]] && return 0 @@ -531,14 +534,38 @@ fetch_dzq(){ curl -Ls "$url" > "$file" logger INFO "Updated DZQ to sha '$sha'" } +fetch_icons(){ + res=( + "16" + "24" + "32" + "48" + "64" + "96" + "128" + "256" + ) + url="$stable_url/images/icons" + for i in "${res[@]}"; do + size="${i}x${i}" + dir="$HOME/.local/share/icons/hicolor/$size/apps" + icon="$dir/$app_name.png" + [[ -f $icon ]] && return + if [[ ! -d $dir ]]; then + mkdir -p "$dir" + fi + logger INFO "Updating $size Freedesktop icon" + curl -Ls "${url}/${i}.png" > "$icon" + done +} fetch_helpers_by_sum(){ [[ -f "$config_file" ]] && source "$config_file" declare -A sums sums=( - ["ui.py"]="c62e84ddd1457b71a85ad21da662b9af" + ["ui.py"]="b5e27858e4aaf966067d452f7e44b9eb" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="5ebf7c9694c9ec8df00f0b30871eeb38" + ["funcs"]="44eca80b207057423c2d298cc7cf1e29" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" @@ -602,6 +629,8 @@ fetch_helpers(){ fetch_geo_file fetch_helpers_by_sum [[ ! -f $share_path/icon.png ]] && freedesktop_dirs + #TODO: integration test + #fetch_icons } raise_error_and_quit(){ local msg="$1" @@ -896,7 +925,7 @@ uninstall(){ } main(){ local zenv=$(zenity --version 2>/dev/null) - [[ -z $zenv ]] && { echo "Requires zenity <= 3.44.1"; exit 1; } + [[ -z $zenv ]] && { echo "Requires zenity >= ${deps[$steamsafe_zenity]}"; exit 1; } if [[ $1 == "--uninstall" ]] || [[ $1 == "-u" ]]; then uninstall && exit 0 diff --git a/helpers/funcs b/helpers/funcs index 9d9c3a9..7d19b29 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -o pipefail -version=5.2.3 +version=5.3.3 #CONSTANTS aid=221100 @@ -978,6 +978,7 @@ generate_log(){ cat <<-DOC > $system_log Distro: $(< /etc/os-release grep -w NAME | awk -F\" '{print $2}') Kernel: $(uname -mrs) + CPU: $(< /proc/cpuinfo awk -F": " '/model name/ {print $2; exit}') Version: $version Branch: $branch Mode: $(if [[ -z $debug ]]; then echo normal; else echo debug; fi) diff --git a/helpers/ui.py b/helpers/ui.py index d988fd0..74e6113 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -19,7 +19,7 @@ gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib, Gdk, GObject, Pango from enum import Enum -# 5.2.3 +# 5.3.3 app_name = "DZGUI" start_time = 0 diff --git a/images/icons/128.png b/images/icons/128.png new file mode 100644 index 0000000..b6aed5c Binary files /dev/null and b/images/icons/128.png differ diff --git a/images/icons/16.png b/images/icons/16.png new file mode 100644 index 0000000..b4500d3 Binary files /dev/null and b/images/icons/16.png differ diff --git a/images/icons/24.png b/images/icons/24.png new file mode 100644 index 0000000..403aba1 Binary files /dev/null and b/images/icons/24.png differ diff --git a/images/icons/256.png b/images/icons/256.png new file mode 100644 index 0000000..204ca9d Binary files /dev/null and b/images/icons/256.png differ diff --git a/images/icons/32.png b/images/icons/32.png new file mode 100644 index 0000000..6736f85 Binary files /dev/null and b/images/icons/32.png differ diff --git a/images/icons/48.png b/images/icons/48.png new file mode 100644 index 0000000..9e636c3 Binary files /dev/null and b/images/icons/48.png differ diff --git a/images/icons/64.png b/images/icons/64.png new file mode 100644 index 0000000..37ba624 Binary files /dev/null and b/images/icons/64.png differ diff --git a/images/icons/96.png b/images/icons/96.png new file mode 100644 index 0000000..7a34cfb Binary files /dev/null and b/images/icons/96.png differ