Update proxy_set_linux_sh

https://github.com/2dust/v2rayN/issues/6886
This commit is contained in:
2dust 2025-03-16 11:01:23 +08:00
parent 701138617c
commit a02a122dd1

View file

@ -80,13 +80,19 @@ set_kde_proxy() {
# Detect the current desktop environment # Detect the current desktop environment
detect_desktop_environment() { detect_desktop_environment() {
if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ] || [ "$XDG_CURRENT_DESKTOP" == "ubuntu:GNOME" ] || [ "$XDG_SESSION_DESKTOP" == "GNOME" ] || [ "$XDG_SESSION_DESKTOP" == "ubuntu:GNOME" ]; then if [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]] || [[ "$XDG_SESSION_DESKTOP" == *"GNOME"* ]]; then
echo "gnome" echo "gnome"
elif [ "$XDG_CURRENT_DESKTOP" == "KDE" ] || [ "$XDG_CURRENT_DESKTOP" == "plasma" ] || [ "$XDG_SESSION_DESKTOP" == "KDE" ] || [ "$XDG_SESSION_DESKTOP" == "plasma" ]; then return
echo "kde"
else
echo "unsupported"
fi fi
local KDE_ENVIRONMENTS=("KDE" "plasma")
for ENV in "${KDE_ENVIRONMENTS[@]}"; do
if [ "$XDG_CURRENT_DESKTOP" == "$ENV" ] || [ "$XDG_SESSION_DESKTOP" == "$ENV" ]; then
echo "kde"
return
fi
done
echo "unsupported"
} }
# Main script logic # Main script logic