From 10527026fe32bfb409c3f20b43e57f03fbc65d1a Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Thu, 18 May 2017 08:47:46 +0800 Subject: [PATCH 01/16] 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" ;; From 62952a1f5683ba1d3bcf9d89699ae07615445e0b Mon Sep 17 00:00:00 2001 From: Yuki Takeya Date: Thu, 18 May 2017 12:02:13 +0900 Subject: [PATCH 02/16] Fix Build --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index b1156ef6..a5502f38 100755 --- a/neofetch +++ b/neofetch @@ -1636,7 +1636,7 @@ get_term() { # Check $PPID for terminal emulator. while [[ -z "$term" ]]; do parent="$(get_ppid "$parent")" - if [ $parent -lt 2 ]; then +       if [ "$parent" -lt 2 ]; then parent=1 term="kernel shell on $(tty)" fi @@ -4322,4 +4322,4 @@ main() { return 0 } -main "$@" +main "$@" \ No newline at end of file From 7e176284a7aef6e58258f2024b80ad28c91edd5b Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Thu, 18 May 2017 14:47:02 +0800 Subject: [PATCH 03/16] Fix Some Bugs --- ascii/distro/{ks => kslinux} | 0 neofetch | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) rename ascii/distro/{ks => kslinux} (100%) diff --git a/ascii/distro/ks b/ascii/distro/kslinux similarity index 100% rename from ascii/distro/ks rename to ascii/distro/kslinux diff --git a/neofetch b/neofetch index a5502f38..10296eb9 100755 --- a/neofetch +++ b/neofetch @@ -102,8 +102,10 @@ 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)" @@ -435,6 +437,7 @@ 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$)))" @@ -3077,7 +3080,7 @@ get_distro_colors() { "KSLinux"*) set_colors 4 7 1 - ascii_file="ks" + ascii_file="kslinux" ;; "Kubuntu"*) @@ -3385,7 +3388,7 @@ get_distro_colors() { ascii_file="void" ;; - *"[Windows 10]"* | *"on Windows 10"* | "Windows 8"* | "Windows 10"*) + *"[Windows 10]"* | *"on Windows 10"* | "Windows 8"* | "Windows 10"* | "windows10" | "windows8" ) set_colors 6 7 ascii_file="windows10" ;; From 4781f48e27b745b440af76e113d0f61ad0a46384 Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Thu, 18 May 2017 14:56:35 +0800 Subject: [PATCH 04/16] Fix Bugs --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 10296eb9..4e92f6f9 100755 --- a/neofetch +++ b/neofetch @@ -1639,7 +1639,7 @@ get_term() { # Check $PPID for terminal emulator. while [[ -z "$term" ]]; do parent="$(get_ppid "$parent")" -       if [ "$parent" -lt 2 ]; then + if [ "$parent" -lt 2 ]; then parent=1 term="kernel shell on $(tty)" fi From 8f7b330bf721cb4fbeff1f32f5fecda19296dcba Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Thu, 18 May 2017 21:38:07 +0700 Subject: [PATCH 05/16] Distro [GuixSD]: Add version and shorthand option --- neofetch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index da64c02e..9b852186 100755 --- a/neofetch +++ b/neofetch @@ -91,7 +91,10 @@ get_distro() { distro="$(lsb_release $lsb_flags)" elif type -p guix >/dev/null; then - distro="GuixSD" + case "$distro_shorthand" in + "on" | "tiny") distro="GuixSD" ;; + *) distro="GuixSD $(guix system -V | awk 'NR==1{printf $5}')" + esac elif type -p crux >/dev/null; then distro="$(crux)" From 4b0cf233a86e150766cf6f45d18045a3e71a29d7 Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Sat, 20 May 2017 14:56:27 +0900 Subject: [PATCH 06/16] Remove PID Check --- neofetch | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/neofetch b/neofetch index ce553deb..0fada33c 100755 --- a/neofetch +++ b/neofetch @@ -1640,12 +1640,7 @@ get_term() { esac # Check $PPID for terminal emulator. - while [[ -z "$term" ]]; do - parent="$(get_ppid "$parent")" - if [ "$parent" -lt 2 ]; then - parent=1 - term="kernel shell on $(tty)" - fi + while [[ -z "$term" ]] || ((parent > 1)); do name="$(get_process_name "$parent")" From 82687cd6bf44e37ecfe294b900a8d1d37cc47298 Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Sat, 20 May 2017 21:10:49 +0900 Subject: [PATCH 07/16] Fix Get Terminal Dead Loop --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 0fada33c..24ad3386 100755 --- a/neofetch +++ b/neofetch @@ -1651,6 +1651,7 @@ get_term() { "gnome-terminal-") term="gnome-terminal" ;; *) term="${name##*/}" ;; esac + break; done # Log that the function was run. @@ -4323,4 +4324,4 @@ main() { return 0 } -main "$@" \ No newline at end of file +main "$@" From 1f510e2b3267d2106fa0cb40a8cd431397ca66e2 Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Sat, 20 May 2017 21:36:51 +0900 Subject: [PATCH 08/16] Fix Terminal Check --- neofetch | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 24ad3386..4f29f239 100755 --- a/neofetch +++ b/neofetch @@ -1640,10 +1640,9 @@ get_term() { esac # Check $PPID for terminal emulator. - while [[ -z "$term" ]] || ((parent > 1)); do - + while [[ -z "$term" ]]; do + parent="$(get_ppid "$parent")" name="$(get_process_name "$parent")" - case "${name// }" in "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; "login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;; @@ -1651,7 +1650,6 @@ get_term() { "gnome-terminal-") term="gnome-terminal" ;; *) term="${name##*/}" ;; esac - break; done # Log that the function was run. From 60f5009cf8d322e606b0f71ab3a950e4d6aa167e Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Sat, 20 May 2017 21:58:18 +0900 Subject: [PATCH 09/16] Fix Terminal Check --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 4f29f239..9042bcba 100755 --- a/neofetch +++ b/neofetch @@ -1640,14 +1640,14 @@ get_term() { esac # Check $PPID for terminal emulator. - while [[ -z "$term" ]]; do + while [[ -z "$term" ]] || ((parent>1)); do parent="$(get_ppid "$parent")" name="$(get_process_name "$parent")" case "${name// }" in "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; - "login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;; + "login"* | *"Login"* | "init" | "(init)") term="$(tty)";break ;; "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;; - "gnome-terminal-") term="gnome-terminal" ;; + "gnome-terminal-") term="gnome-terminal";break ;; *) term="${name##*/}" ;; esac done From df6dab1721e43ca8e2056c2e0ba8f665c2207591 Mon Sep 17 00:00:00 2001 From: Takeya Yuki Date: Sat, 20 May 2017 22:17:56 +0900 Subject: [PATCH 10/16] Rollback without PID Check --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 9042bcba..4f29f239 100755 --- a/neofetch +++ b/neofetch @@ -1640,14 +1640,14 @@ get_term() { esac # Check $PPID for terminal emulator. - while [[ -z "$term" ]] || ((parent>1)); do + while [[ -z "$term" ]]; do parent="$(get_ppid "$parent")" name="$(get_process_name "$parent")" case "${name// }" in "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; - "login"* | *"Login"* | "init" | "(init)") term="$(tty)";break ;; + "login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;; "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;; - "gnome-terminal-") term="gnome-terminal";break ;; + "gnome-terminal-") term="gnome-terminal" ;; *) term="${name##*/}" ;; esac done From 8e7fe64d82d4bc2e5536ca63fa01007741386932 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Wed, 24 May 2017 13:03:27 +1000 Subject: [PATCH 11/16] DOCS: Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b80a93a..b8760ad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,18 +6,21 @@ - **[@mstraube](https://github.com/mstraube)** - **[@Artoriuz](https://github.com/Artoriuz)** - **[@WilsonRU](https://github.com/WilsonRU)** +- **[@Takeya-Yuki](https://github.com/Takeya-Yuki)** ## Operating System - Added support for Arch XFerience. **[@mstraube](https://github.com/mstraube)** - Added support for Maui. **[@mstraube](https://github.com/mstraube)** +- Added support for KS Linux. **[@Takeya-Yuki](https://github.com/Takeya-Yuki)** ## General - Minimum required BASH version is now 3.2. - (Neofetch has always used 3.2+ features, I've just made it obvious now in the documentation.) +- Fixed config file not being created. ## Images From d1fa88b7423cf8b9e4bc7445b9b6e37738b83869 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Wed, 24 May 2017 13:07:01 +1000 Subject: [PATCH 12/16] Config: Fix config not being created --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 4f29f239..fb9d320e 100755 --- a/neofetch +++ b/neofetch @@ -2300,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 @@ -3576,7 +3576,7 @@ get_user_config() { config_file="${XDG_CONFIG_HOME}/neofetch/config" elif [[ -f "/etc/neofetch/config" ]]; then - cp "/usr/share/neofetch/config" "${XDG_CONFIG_HOME}/neofetch" + cp "/etc/neofetch/config" "${XDG_CONFIG_HOME}/neofetch" config_file="${XDG_CONFIG_HOME}/neofetch/config" elif [[ -f "/usr/local/etc/neofetch/config" ]]; then From 767cd93f38fa368c1f02b01f919ac6672867b2ee Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Fri, 26 May 2017 09:21:22 +1000 Subject: [PATCH 13/16] change output for iPhone 5, fixes #730 --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index fb9d320e..ea2c4e93 100755 --- a/neofetch +++ b/neofetch @@ -263,7 +263,7 @@ get_model() { "iPhone2,1") model="iPhone 3GS" ;; "iPhone3,"[1-3]) model="iPhone 4" ;; "iPhone4,1") model="iPhone 4S" ;; - "iPhone5,"[1-2]) model="iPhone 4" ;; + "iPhone5,"[1-2]) model="iPhone 5" ;; "iPhone5,"[3-4]) model="iPhone 5c" ;; "iPhone6,"[1-2]) model="iPhone 5s" ;; "iPhone7,2") model="iPhone 6" ;; From 329346d460ed15bbe6fbf751c26be203ca52fde9 Mon Sep 17 00:00:00 2001 From: LER0ever Date: Sat, 27 May 2017 13:30:02 +0800 Subject: [PATCH 14/16] Model: add support for Hackintosh --- neofetch | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index ea2c4e93..1a50b374 100755 --- a/neofetch +++ b/neofetch @@ -242,7 +242,13 @@ get_model() { fi ;; - "Mac OS X") model="$(sysctl -n hw.model)" ;; + "Mac OS X") + if [[ $(kextstat | grep "FakeSMC") != "" ]]; then + model="Hackintosh (SMBIOS: $(sysctl -n hw.model))" + else + model="$(sysctl -n hw.model)" + fi + ;; "iPhone OS") case "$machine_arch" in "iPad1,1") model="iPad" ;; From 0f945f9b637c33eb96fdf56029590df4466f9882 Mon Sep 17 00:00:00 2001 From: LER0ever Date: Sat, 27 May 2017 14:06:45 +0800 Subject: [PATCH 15/16] fix(style): double quote vars, remove unnecessary empty check --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 1a50b374..99f66bc4 100755 --- a/neofetch +++ b/neofetch @@ -243,7 +243,7 @@ get_model() { ;; "Mac OS X") - if [[ $(kextstat | grep "FakeSMC") != "" ]]; then + if [[ "$(kextstat | grep "FakeSMC")" ]]; then model="Hackintosh (SMBIOS: $(sysctl -n hw.model))" else model="$(sysctl -n hw.model)" From e68fc1167b3d55322e86bc709b0b0d8261c840d1 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 27 May 2017 16:17:41 +1000 Subject: [PATCH 16/16] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8760ad9..f09204b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - **[@Artoriuz](https://github.com/Artoriuz)** - **[@WilsonRU](https://github.com/WilsonRU)** - **[@Takeya-Yuki](https://github.com/Takeya-Yuki)** +- **[@LER0ever](https://github.com/LER0ever)** ## Operating System @@ -53,3 +54,7 @@ **Song** - Do not detect ibus\* or indicator\* as player. **[@dawidd6](https://github.com/dawidd6)** + +**Model** + +- Specify when running on a Hackintosh. **[@LER0ever](https://github.com/LER0ever)**