From 10527026fe32bfb409c3f20b43e57f03fbc65d1a Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Thu, 18 May 2017 08:47:46 +0800 Subject: [PATCH] Add KSLinux Support --- ascii/distro/ks | 11 +++++++++++ neofetch | 23 ++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 ascii/distro/ks diff --git a/ascii/distro/ks b/ascii/distro/ks new file mode 100644 index 00000000..53385bd8 --- /dev/null +++ b/ascii/distro/ks @@ -0,0 +1,11 @@ +${c1} K K U U RRRR ooo + K K U U R R o o + KKK U U RRRR o o + K K U U R R o o + K K UUU R R ooo + +${c2} SSS AAA W W AAA + S A A W W A A + SSS AAAAA W W W AAAAA + S A A WW WW A A + SSS A A W W A A diff --git a/neofetch b/neofetch index da64c02e..b1156ef6 100755 --- a/neofetch +++ b/neofetch @@ -102,7 +102,8 @@ get_distro() { elif type -p tazpkg >/dev/null; then distro="SliTaz $(< /etc/slitaz-release)" - + elif type -p kpm > /dev/null; then + distro="KSLinux" elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then distro="Android $(getprop ro.build.version.release)" @@ -434,6 +435,8 @@ get_packages() { type -p dpkg >/dev/null && \ packages="$((packages+=$(dpkg --get-selections | grep -cv deinstall$)))" + type -p kpm >/dev/null && \ + packages="$((packages+=$(kpm --get-selections | grep -cv deinstall$)))" type -p pkgtool >/dev/null && \ packages="$((packages+=$(ls -1 /var/log/packages | wc -l)))" @@ -1633,8 +1636,13 @@ get_term() { # Check $PPID for terminal emulator. while [[ -z "$term" ]]; do parent="$(get_ppid "$parent")" - name="$(get_process_name "$parent")" + if [ $parent -lt 2 ]; then + parent=1 + term="kernel shell on $(tty)" + fi + name="$(get_process_name "$parent")" + case "${name// }" in "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; "login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;; @@ -2292,10 +2300,10 @@ get_w3m_img_path() { elif [[ -x "/usr/libexec64/w3m/w3mimgdisplay" ]]; then w3m_img_path="/usr/libexec64/w3m/w3mimgdisplay" - + elif [[ -x "/usr/local/libexec/w3m/w3mimgdisplay" ]]; then w3m_img_path="/usr/local/libexec/w3m/w3mimgdisplay" - + else err "Image: w3m-img wasn't found on your system" fi @@ -3067,6 +3075,11 @@ get_distro_colors() { ascii_file="korora" ;; + "KSLinux"*) + set_colors 4 7 1 + ascii_file="ks" + ;; + "Kubuntu"*) set_colors 4 7 1 ascii_file="kubuntu" @@ -3372,7 +3385,7 @@ get_distro_colors() { ascii_file="void" ;; - *"[Windows 10]"* | *"on Windows 10"* | "Windows 8"* | "Windows 10"* | "windows10" | "windows8" ) + *"[Windows 10]"* | *"on Windows 10"* | "Windows 8"* | "Windows 10"*) set_colors 6 7 ascii_file="windows10" ;;