@@ -94,46 +94,50 @@ trap cleanup EXIT # Register the cleanup function to be called on script exit.
9494
9595TMP_DIR=$( mktemp -d)
9696
97- # Check Ubuntu Version Function
97+ # Check OS Version Function
9898#
9999# Purpose:
100- # This function checks if the current operating system is Ubuntu 24.04 or Linux Mint 22. It does this by reading
101- # the /etc/os-release file, which contains identification data for the operating system.
100+ # This function checks if the current operating system is Ubuntu 24.04, Linux Mint 22, or Kali Linux 2024.2 or newer.
101+ # It reads the /etc/os-release file, which contains identification data for the operating system.
102102#
103103# Behavior:
104104# 1. The function first checks if the /etc/os-release file exists.
105105# 2. If the file exists, it sources the file to load the OS identification variables.
106- # 3. It then checks if the ID variable is set to "ubuntu" and the VERSION_ID variable is set to "24.04",
107- # or if the ID variable is set to "linuxmint" and the VERSION_ID variable is set to "22".
108- # 4. If either set of conditions is met, the function returns 0 (indicating success).
109- # 5. If neither set of conditions is met, the function returns 1 (indicating failure).
106+ # 3. It then checks if:
107+ # - The ID variable is set to "ubuntu" and the VERSION_ID variable is "24.04",
108+ # - The ID variable is "linuxmint" and the VERSION_ID is "22",
109+ # - The ID variable is "kali" and the VERSION_ID is "2024.2" or newer.
110+ # 4. If any of these conditions are met, the function returns 0 (indicating success).
111+ # 5. If none of these conditions are met, the function returns 1 (indicating failure).
110112#
111113# Usage:
112- # This function can be called to determine if special handling is needed for Ubuntu 24.04 or Linux Mint 22, such as
113- # installing additional libraries or making compatibility adjustments.
114+ # This function can be called to determine if special handling is needed for these specific versions of
115+ # Ubuntu, Linux Mint, or Kali Linux, such as installing additional libraries or making compatibility adjustments.
114116#
115117# Example:
116- # if check_ubuntu_version ; then
117- # echo "Ubuntu 24.04 or Linux Mint 22 detected."
118+ # if check_os_version ; then
119+ # echo "Supported OS version detected."
118120# else
119- # echo "Neither Ubuntu 24.04 nor Linux Mint 22 ."
121+ # echo "Unsupported OS version ."
120122# fi
121123#
122124# Notes:
123125# - This function assumes that the /etc/os-release file follows the standard format for Linux OS
124- # identification.
126+ # identification and that the distribution's identifiers are consistent with those specified in the script .
125127
126- check_ubuntu_version () {
128+
129+ check_os_version () {
127130 if [ -f /etc/os-release ]; then
128131 . /etc/os-release
129- if [[ " $ID " = " ubuntu" && " $VERSION_ID " = " 24.04" ]] || [[ " $ID " = " linuxmint" && " $VERSION_ID " = " 22" ]]; then
130- return 0 # Ubuntu 24.04 or Linux Mint 22 detected
132+ if [[ " $ID " = " ubuntu" && " $VERSION_ID " = " 24.04" ]] ||
133+ [[ " $ID " = " linuxmint" && " $VERSION_ID " = " 22" ]] ||
134+ ([[ " $ID " = " kali" ]] && [[ " $VERSION_ID " > " 2024.2" ]] || [[ " $VERSION_ID " == " 2024.2" ]]); then
135+ return 0 # Ubuntu 24.04, Linux Mint 22, or Kali Linux 2024.2 or newer detected
131136 fi
132137 fi
133- return 1 # Neither Ubuntu 24.04 nor Linux Mint 22
138+ return 1 # None of the specified versions detected
134139}
135140
136-
137141# Create Invocation Script Function
138142#
139143# Purpose:
@@ -304,7 +308,7 @@ download_and_install_gtk() {
304308 # - This piece of code should only be executed if the package manager does not distribute
305309 # libgtk or if the version provided by the package manager is not compatible with Phoenix Code.
306310
307- local URL_PREFIX=" https://github.com/phcode-dev/dependencies/releases/download/v1.0.2 /"
311+ local URL_PREFIX=" https://github.com/phcode-dev/dependencies/releases/download/v1.0.3 /"
308312 local GTK_FILE=" gtk.tar.xz"
309313 local WEBKIT2GTK_FILE=" webkit2gtk-4.0.tar.xz"
310314
@@ -456,7 +460,7 @@ verify_and_install_dependencies() {
456460 echo " Application launch verification successful."
457461 return 0
458462 else
459- if check_ubuntu_version ; then
463+ if check_os_version ; then
460464 echo -e " ${YELLOW} Ubuntu 24.04 detected. Attempting to download and install GTK and WebKit2GTK...${RESET} "
461465 download_and_install_gtk
462466 create_launch_script_with_gtk " $TMP_DIR /phoenix-code"
0 commit comments