From 593ca37d261ab061cf33c29d7bdf55f2bf6dd354 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 28 May 2017 14:44:13 +1000 Subject: [PATCH 1/5] Revert "Model: Add support for Hackintosh" --- neofetch | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/neofetch b/neofetch index 99f66bc4..ea2c4e93 100755 --- a/neofetch +++ b/neofetch @@ -242,13 +242,7 @@ get_model() { fi ;; - "Mac OS X") - if [[ "$(kextstat | grep "FakeSMC")" ]]; then - model="Hackintosh (SMBIOS: $(sysctl -n hw.model))" - else - model="$(sysctl -n hw.model)" - fi - ;; + "Mac OS X") model="$(sysctl -n hw.model)" ;; "iPhone OS") case "$machine_arch" in "iPad1,1") model="iPad" ;; From 0ff2807c75681546e9de9245a840c406da3b9d4f Mon Sep 17 00:00:00 2001 From: LER0ever Date: Tue, 30 May 2017 17:05:33 +0800 Subject: [PATCH 2/5] Model: Add support for Hackintosh --- neofetch | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index ea2c4e93..040226fa 100755 --- a/neofetch +++ b/neofetch @@ -242,7 +242,14 @@ 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 6762381a82ebb51667e6883ad7fc03d5f720a7ef Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Fri, 2 Jun 2017 19:22:51 +0700 Subject: [PATCH 3/5] Terminal: Disable terminal detection if device is connected over SSH --- neofetch | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index 040226fa..802e43f7 100755 --- a/neofetch +++ b/neofetch @@ -1648,15 +1648,19 @@ get_term() { # Check $PPID for terminal emulator. 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)" ;; - "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;; - "gnome-terminal-") term="gnome-terminal" ;; - *) term="${name##*/}" ;; - esac + if [[ "$SSH_CONNECTION" ]]; then + term="$SSH_TTY" + else + parent="$(get_ppid "$parent")" + name="$(get_process_name "$parent")" + case "${name// }" in + "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; + "login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;; + "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;; + "gnome-terminal-") term="gnome-terminal" ;; + *) term="${name##*/}" ;; + esac + fi done # Log that the function was run. From b355096f4c726907d8849ccd4993885c10ffd58b Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sat, 3 Jun 2017 13:55:34 +0700 Subject: [PATCH 4/5] docs: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f09204b8..f58fe482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - Added font support for mate-terminal. **[@mstraube](https://github.com/mstraube)** - [Termite] Fix font mismatch. **[@MatthewCox](https://github.com/MatthewCox)** +- Use `$SSH_TTY` for terminal detection if machine is connected via SSH. **GPU** From c7c84fcbba74770ccacae3c8e62308a9e4a8e3cb Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sun, 4 Jun 2017 00:03:03 +0700 Subject: [PATCH 5/5] Term: Break from loop if PPID can't be accessed/not found --- neofetch | 1 + 1 file changed, 1 insertion(+) diff --git a/neofetch b/neofetch index 802e43f7..6019a6d5 100755 --- a/neofetch +++ b/neofetch @@ -1652,6 +1652,7 @@ get_term() { term="$SSH_TTY" else parent="$(get_ppid "$parent")" + [[ -z "$parent" ]] && break name="$(get_process_name "$parent")" case "${name// }" in "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;;