From d2dfd950a376f19b7c95ee3ff708c4377136c9ab Mon Sep 17 00:00:00 2001 From: Yuki Kurosawa Date: Sun, 6 Apr 2025 13:03:39 +0800 Subject: [PATCH] Update KSLinux detection due to kpt and kpm command is removed (#395) * Update KSLinux detection due to kpt and kpm command is removed * Fix Bugs --- neofetch | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index e75b7f4d..9f9067f5 100755 --- a/neofetch +++ b/neofetch @@ -1198,7 +1198,15 @@ get_distro() { elif type -p lsb_release >/dev/null; then # Debian does not include .x versions in /etc/os-version, but does in debian_version # So if that file exists, and we are not *buntu, build name from there - if [[ -f /etc/debian_version ]] && [[ $(lsb_release -si) != *"buntu"* ]] && [[ $(lsb_release -si) != *"neon"* ]]; then + if [[ $(lsb_release -si) = *"KSLinux"* ]] + then + . /etc/os-release + case $distro_shorthand in + on) distro=${NAME} ;; + tiny) distro=${NAME} ;; + *) distro="${NAME} ${VERSION}" ;; + esac + elif [[ -f /etc/debian_version ]] && [[ $(lsb_release -si) != *"buntu"* ]] && [[ $(lsb_release -si) != *"neon"* ]]; then . /etc/os-release case $distro_shorthand in on) distro="${NAME}" ;; @@ -1257,10 +1265,6 @@ get_distro() { elif type -p tazpkg >/dev/null; then distro="SliTaz $(< /etc/slitaz-release)" - elif type -p kpt >/dev/null && \ - type -p kpm >/dev/null; then - distro=KSLinux - elif [[ -d /system/app/ && -d /system/priv-app ]]; then distro="Android $(getprop ro.build.version.release)" @@ -2237,7 +2241,6 @@ get_packages() { fi # Other (Needs complex command) - has kpm-pkg && ((packages+=$(kpm --get-selections | grep -cv deinstall$))) nix-user-pkgs() { if [ -d ~/.nix-profile ]; then