Skip to content

Commit da45304

Browse files
committed
fix: catch os not working
1 parent 1380036 commit da45304

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

docs/linux/installer.sh

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ TMP_DIR=$(mktemp -d)
127127
check_os_version() {
128128
if [ -f /etc/os-release ]; then
129129
. /etc/os-release
130+
# Set VERSION_ID to empty string if not defined (for rolling releases)
131+
VERSION_ID="${VERSION_ID:-}"
130132
# Define supported OS and version combinations
131133
case "$ID:${VERSION_ID%%.*}" in # Extract major version number
132134
ubuntu:24) # Ubuntu 24.x
@@ -275,9 +277,11 @@ install_dependencies() {
275277
yes | sudo dnf upgrade webkit2gtk3 gtk3 \
276278
gstreamer1 gstreamer1-plugins-base gstreamer1-plugins-good
277279
;;
278-
arch|manjaro)
280+
arch|manjaro|cachyos)
279281
echo "Detected an Arch Linux based distribution."
280-
yes | sudo pacman -S webkit2gtk gtk3
282+
echo "Updating package database..."
283+
sudo pacman -Sy
284+
yes | sudo pacman -S webkit2gtk gtk3 libxml2
281285
;;
282286
*)
283287
echo "Unsupported distribution. Please manually install the required dependencies."
@@ -495,6 +499,26 @@ verify_and_install_dependencies() {
495499
set_default_application() {
496500
local desktop_file="$DESKTOP_ENTRY_NAME" # Name of the Phoenix Code desktop entry file
497501

502+
# Dynamically detect qtpaths if KDE is running and qtpaths is not in PATH
503+
if [ "${KDE_SESSION_VERSION:-0}" -gt 0 ] && ! command -v qtpaths &> /dev/null; then
504+
# Common locations where qtpaths might be installed
505+
local qtpaths_locations=(
506+
"/usr/lib/qt6/bin"
507+
"/usr/lib/qt5/bin"
508+
"/usr/lib64/qt6/bin"
509+
"/usr/lib64/qt5/bin"
510+
"/opt/qt6/bin"
511+
"/opt/qt5/bin"
512+
)
513+
514+
for qtpath_dir in "${qtpaths_locations[@]}"; do
515+
if [ -x "$qtpath_dir/qtpaths" ] || [ -x "$qtpath_dir/qtpaths6" ]; then
516+
export PATH="$qtpath_dir:$PATH"
517+
break
518+
fi
519+
done
520+
fi
521+
498522
for mime_type in "${MIME_TYPES[@]}"; do
499523
# Skip setting default application for text/html
500524
if [ "$mime_type" = "text/html" ]; then

0 commit comments

Comments
 (0)