From fb7b3c146ea9287e354fad7300398a3ea514b4e9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 10:00:09 +1100 Subject: [PATCH 01/17] Rewrite uptime --- neofetch | 73 +++++++++++++++++++++----------------------------------- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/neofetch b/neofetch index 78661991..1f5bf818 100755 --- a/neofetch +++ b/neofetch @@ -269,65 +269,46 @@ getkernel() { getuptime() { case "$os" in - "Linux" | "Windows") - case "$distro" in - *"Puppy"* | "Quirky Werewolf"* | "Alpine Linux"* | "OpenWRT"* | "Windows"*) - uptime="$(uptime | awk -F ':[0-9]{2}+ |(, ){1}+' '{printf $2}')" + "Linux" | "Windows" | "Mac OS X" | "iPhone OS" | "BSD") + # Get uptime in seconds + case "$os" in + "Linux" | "Windows") + seconds="$(< /proc/uptime)" + seconds="${seconds/.*}" ;; - "openSUSE"*) - uptime="$(uptime | awk -F ':[0-9]{2}+[a-z][a-z] |(, ){1}+' '{printf $2}')" - ;; + "Mac OS X" | "iPhone OS" | "BSD") + boot="$(sysctl -n kern.boottime)" + boot="${boot/'{ sec = '}" + boot="${boot/,*}" - *) - uptime="$(uptime -p)" - [ "$uptime" == "up " ] && uptime="up $(awk -F'.' '{print $1}' /proc/uptime) seconds" + # Get current date in seconds + now="$(date +%s)" + seconds="$((now - boot))" ;; esac - ;; - "Mac OS X" | "iPhone OS" | "BSD") - # Get boot time in seconds - boot="$(sysctl -n kern.boottime)" - boot="${boot/'{ sec = '}" - boot="${boot/,*}" + days="$((seconds / 86400)) days" + hours="$((seconds / 3600)) hours" + minutes="$((seconds % 3600 / 60)) minutes" - # Get current date in seconds - now="$(date +%s)" - uptime="$((now - boot))" - - # Convert uptime to days/hours/mins - minutes="$((uptime / 60%60))" - hours="$((uptime / 3600%24))" - days="$((uptime / 86400))" - - case "$minutes" in - 1) minutes="1 minute" ;; - 0) unset minutes ;; - *) minutes="$minutes minutes" ;; + case "$days" in + "0 days") unset days ;; + "1 days") days="${days/s}" ;; esac case "$hours" in - 1) hours="1 hour" ;; - 0) unset hours ;; - *) hours="$hours hours" ;; + "0 hours") unset hours ;; + "1 hours") hours="${hours/s}" ;; esac - case "$days" in - 1) days="1 day" ;; - 0) unset days ;; - *) days="$days days" ;; + case "$minutes" in + "0 minutes") unset minutes ;; + "1 minutes") minutes="${minutes/s}" ;; esac - [ "$hours" ] && \ - [ "$minutes" ] && \ - hours+="," - - [ "$days" ] && \ - [ "$hours" ] && \ - days+="," - - uptime="up $days $hours $minutes" + uptime="up ${days:+$days,} ${hours:+$hours,} ${minutes}" + uptime="${uptime%', '}" ;; "Solaris") @@ -353,7 +334,7 @@ getuptime() { uptime="${uptime/ minutes/m}" uptime="${uptime/ minute/m}" uptime="${uptime/ seconds/s}" - uptime="${uptime/,}" + uptime="${uptime//,}" ;; esac } From c2e6f6534d9b0a2ce15417607b38055edbb169ba Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 10:20:28 +1100 Subject: [PATCH 02/17] Fix errors on large uptimes --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 1f5bf818..642e4566 100755 --- a/neofetch +++ b/neofetch @@ -288,9 +288,9 @@ getuptime() { ;; esac - days="$((seconds / 86400)) days" - hours="$((seconds / 3600)) hours" - minutes="$((seconds % 3600 / 60)) minutes" + days="$((seconds / 60 / 60 / 24)) days" + hours="$((seconds / 60 / 60 % 24)) hours" + minutes="$((seconds / 60 % 60)) minutes" case "$days" in "0 days") unset days ;; From 99d43ff257f146b01d3e4f21e28dc7ce3c8246a8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 10:37:40 +1100 Subject: [PATCH 03/17] Add seconds when uptime is below 1 min --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 642e4566..94f3b4c3 100755 --- a/neofetch +++ b/neofetch @@ -307,8 +307,9 @@ getuptime() { "1 minutes") minutes="${minutes/s}" ;; esac - uptime="up ${days:+$days,} ${hours:+$hours,} ${minutes}" + uptime="${days:+$days, }${hours:+$hours, }${minutes}" uptime="${uptime%', '}" + uptime="up ${uptime:-${seconds} seconds}" ;; "Solaris") From dc32c0b71cc263e4cec410ddcd7fac721863e29b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 16:26:34 +1100 Subject: [PATCH 04/17] Add option to hide/show hypertheaded cpu cores --- neofetch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 3819e310..74a48387 100755 --- a/neofetch +++ b/neofetch @@ -724,7 +724,11 @@ getcpu() { speed="$((speed / 100))" fi - cores="$(grep -c ^processor /proc/cpuinfo)" + # Show/hide hyperthreaded cores + case "$cores_ht" in + "on") cores="$(grep -c ^processor /proc/cpuinfo)" ;; + "off") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;; + esac # Fix for speeds under 1ghz if [ -z "${speed:1}" ]; then @@ -738,7 +742,12 @@ getcpu() { "Mac OS X") cpu="$(sysctl -n machdep.cpu.brand_string)" - cores="$(sysctl -n hw.ncpu)" + + # Show/hide hyperthreaded cores + case "$cores_ht" in + "on") cores="$(sysctl -n hw.logicalcpu_max)" ;; + "off") cores="$(sysctl -n hw.physicalcpu_max)" ;; + esac ;; "iPhone OS") From 66100fc3510f210ecaa49271720984623d898ece Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 16:38:02 +1100 Subject: [PATCH 05/17] Use cpu_cores --- README.md | 3 ++- config/config | 4 +++- neofetch | 17 +++++++++-------- neofetch.1 | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5dcf1af3..320036fb 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,8 @@ alias neofetch2="neofetch \ NOTE: This only support Linux with cpufreq. --cpu_shorthand type Shorten the output of CPU Possible values: name, speed, tiny, on, off - --cpu_cores on/off Whether or not to display the number of CPU cores + --cpu_cores type Whether or not to display the number of CPU cores + Takes: logical. physical, off --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/config/config b/config/config index d4cc28ba..54969a61 100644 --- a/config/config +++ b/config/config @@ -108,7 +108,9 @@ cpu_display="off" # CPU Cores # Display CPU cores in output -# --cpu_cores on/off +# Logical: All virtual cores +# Physical: All physical cores +# --cpu_cores logical, physical, off cpu_cores="on" diff --git a/neofetch b/neofetch index 74a48387..c5609cd9 100755 --- a/neofetch +++ b/neofetch @@ -725,9 +725,9 @@ getcpu() { fi # Show/hide hyperthreaded cores - case "$cores_ht" in - "on") cores="$(grep -c ^processor /proc/cpuinfo)" ;; - "off") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;; + case "$cpu_cores" in + "logical" | "on") cores="$(grep -c ^processor /proc/cpuinfo)" ;; + "physical") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;; esac # Fix for speeds under 1ghz @@ -744,9 +744,9 @@ getcpu() { cpu="$(sysctl -n machdep.cpu.brand_string)" # Show/hide hyperthreaded cores - case "$cores_ht" in - "on") cores="$(sysctl -n hw.logicalcpu_max)" ;; - "off") cores="$(sysctl -n hw.physicalcpu_max)" ;; + case "$cpu_cores" in + "logical" | "on") cores="$(sysctl -n hw.logicalcpu_max)" ;; + "physical") cores="$(sysctl -n hw.physicalcpu_max)" ;; esac ;; @@ -922,7 +922,7 @@ getcpu() { cpu="${cpu//with Radeon HD Graphics}" # Add cpu cores to output - [ "$cpu_cores" == "on" ] && [ "$cores" ] && \ + [ "$cpu_cores" != "off" ] && [ "$cores" ] && \ cpu="${cpu/@/(${cores}) @}" # Make the output of cpu shorter @@ -2956,7 +2956,8 @@ usage() { cat << EOF NOTE: This only support Linux with cpufreq. --cpu_shorthand type Shorten the output of CPU Possible values: name, speed, tiny, on, off - --cpu_cores on/off Whether or not to display the number of CPU cores + --cpu_cores type Whether or not to display the number of CPU cores + Takes: logical. physical, off --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/neofetch.1 b/neofetch.1 index 71cbf2b9..7f8ac105 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -35,7 +35,7 @@ Shorten the output of CPU .br Possible values: name, speed, tiny, on, off .TP -.B \--cpu_cores 'on/off' +.B \--cpu_cores 'logical/physical/off' Whether or not to display the number of CPU cores .TP .B \--distro_shorthand 'on/off' From bd44f1ea1201ac4150c89f604256a06f7bcbe847 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 16:40:58 +1100 Subject: [PATCH 06/17] Fix grammar error --- README.md | 2 +- config/config | 2 +- neofetch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 320036fb..a397316a 100644 --- a/README.md +++ b/README.md @@ -365,7 +365,7 @@ alias neofetch2="neofetch \ --cpu_shorthand type Shorten the output of CPU Possible values: name, speed, tiny, on, off --cpu_cores type Whether or not to display the number of CPU cores - Takes: logical. physical, off + Takes: logical, physical, off --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/config/config b/config/config index 54969a61..3a0b0eef 100644 --- a/config/config +++ b/config/config @@ -111,7 +111,7 @@ cpu_display="off" # Logical: All virtual cores # Physical: All physical cores # --cpu_cores logical, physical, off -cpu_cores="on" +cpu_cores="logical" # GPU diff --git a/neofetch b/neofetch index c5609cd9..fd6259c5 100755 --- a/neofetch +++ b/neofetch @@ -2957,7 +2957,7 @@ usage() { cat << EOF --cpu_shorthand type Shorten the output of CPU Possible values: name, speed, tiny, on, off --cpu_cores type Whether or not to display the number of CPU cores - Takes: logical. physical, off + Takes: logical, physical, off --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel From 93abca7185d4b3ed1dbc9c35c7b606aeb01dc8d8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 16:54:05 +1100 Subject: [PATCH 07/17] Make note about support --- README.md | 1 + config/config | 1 + neofetch | 1 + neofetch.1 | 2 ++ 4 files changed, 5 insertions(+) diff --git a/README.md b/README.md index a397316a..888a2790 100644 --- a/README.md +++ b/README.md @@ -366,6 +366,7 @@ alias neofetch2="neofetch \ Possible values: name, speed, tiny, on, off --cpu_cores type Whether or not to display the number of CPU cores Takes: logical, physical, off + Note: 'physical' only works on Linux, Windows and macOS. --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/config/config b/config/config index 3a0b0eef..97ba2e82 100644 --- a/config/config +++ b/config/config @@ -111,6 +111,7 @@ cpu_display="off" # Logical: All virtual cores # Physical: All physical cores # --cpu_cores logical, physical, off +# Note: 'physical' only works on Linux, Windows and macOS. cpu_cores="logical" diff --git a/neofetch b/neofetch index fd6259c5..2ef2333a 100755 --- a/neofetch +++ b/neofetch @@ -2958,6 +2958,7 @@ usage() { cat << EOF Possible values: name, speed, tiny, on, off --cpu_cores type Whether or not to display the number of CPU cores Takes: logical, physical, off + Note: 'physical' only works on Linux, Windows and macOS. --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/neofetch.1 b/neofetch.1 index 7f8ac105..64bb852b 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -37,6 +37,8 @@ Possible values: name, speed, tiny, on, off .TP .B \--cpu_cores 'logical/physical/off' Whether or not to display the number of CPU cores +.br +Note: 'physical' only works on Linux, Windows and macOS. .TP .B \--distro_shorthand 'on/off' Shorten the output of distro (tiny, on, off) From 15ccabc5cfa40043e33a6b10e40aa135fa6bb8fa Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 16:54:40 +1100 Subject: [PATCH 08/17] Fix grammar error --- neofetch.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch.1 b/neofetch.1 index 64bb852b..66c58d91 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -53,7 +53,8 @@ Shorten the output of uptime (tiny, on, off) .TP .B \--refresh_rate 'on/off' Whether to display the refresh rate of each monitor -Unsupported on Windows +.br +Note: Unsupported on Windows .TP .B \--gpu_shorthand 'on/off' Shorten the output of GPU (tiny, on, off) From 988216561758e7ebf942b91e786d44b7f3b75deb Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 20:27:35 +1100 Subject: [PATCH 09/17] Add support for Solaris --- neofetch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 2ef2333a..2014644b 100755 --- a/neofetch +++ b/neofetch @@ -893,8 +893,11 @@ getcpu() { speed="$(psrinfo -v | awk '/operates at/ {print $6}')" speed="$((speed / 100))" - # Get cpu cores - cores="$(kstat -m cpu_info | grep -c "chip_id")" + # Show/hide hyperthreaded cores + case "$cpu_cores" in + "logical" | "on") cores="$(kstat -m cpu_info | grep -c "chip_id")" ;; + "physical") cores="$(psrinfo -p)" ;; + esac # Fix for speeds under 1ghz if [ -z "${speed:1}" ]; then From 3123548c1895688b9028c99ac1a799679ad1fca4 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 20:29:16 +1100 Subject: [PATCH 10/17] Update docs --- README.md | 2 +- config/config | 2 +- neofetch | 2 +- neofetch.1 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 888a2790..21546035 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,7 @@ alias neofetch2="neofetch \ Possible values: name, speed, tiny, on, off --cpu_cores type Whether or not to display the number of CPU cores Takes: logical, physical, off - Note: 'physical' only works on Linux, Windows and macOS. + Note: 'physical' doesn't work on BSD. --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/config/config b/config/config index 97ba2e82..605ed6bd 100644 --- a/config/config +++ b/config/config @@ -111,7 +111,7 @@ cpu_display="off" # Logical: All virtual cores # Physical: All physical cores # --cpu_cores logical, physical, off -# Note: 'physical' only works on Linux, Windows and macOS. +# Note: 'physical' doesn't work on BSD. cpu_cores="logical" diff --git a/neofetch b/neofetch index 2014644b..6a54d4e6 100755 --- a/neofetch +++ b/neofetch @@ -2961,7 +2961,7 @@ usage() { cat << EOF Possible values: name, speed, tiny, on, off --cpu_cores type Whether or not to display the number of CPU cores Takes: logical, physical, off - Note: 'physical' only works on Linux, Windows and macOS. + Note: 'physical' doesn't work on BSD. --distro_shorthand on/off Shorten the output of distro (tiny, on, off) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/neofetch.1 b/neofetch.1 index 66c58d91..62e3cd62 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -38,7 +38,7 @@ Possible values: name, speed, tiny, on, off .B \--cpu_cores 'logical/physical/off' Whether or not to display the number of CPU cores .br -Note: 'physical' only works on Linux, Windows and macOS. +Note: 'physical' doesn't work on BSD. .TP .B \--distro_shorthand 'on/off' Shorten the output of distro (tiny, on, off) From e4c7f1926acc525a411385124e172eec8e7e004d Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Fri, 21 Oct 2016 16:06:51 +0700 Subject: [PATCH 11/17] Solaris: Rewritten uptime Solaris' uptime will now show the second mark only so we don't have 2 case instances. --- neofetch | 77 +++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/neofetch b/neofetch index 94f3b4c3..3cdefc07 100755 --- a/neofetch +++ b/neofetch @@ -268,55 +268,52 @@ getkernel() { # Uptime {{{ getuptime() { + # Get uptime in seconds case "$os" in - "Linux" | "Windows" | "Mac OS X" | "iPhone OS" | "BSD") - # Get uptime in seconds - case "$os" in - "Linux" | "Windows") - seconds="$(< /proc/uptime)" - seconds="${seconds/.*}" - ;; + "Linux" | "Windows") + seconds="$(< /proc/uptime)" + seconds="${seconds/.*}" + ;; - "Mac OS X" | "iPhone OS" | "BSD") - boot="$(sysctl -n kern.boottime)" - boot="${boot/'{ sec = '}" - boot="${boot/,*}" + "Mac OS X" | "iPhone OS" | "BSD") + boot="$(sysctl -n kern.boottime)" + boot="${boot/'{ sec = '}" + boot="${boot/,*}" - # Get current date in seconds - now="$(date +%s)" - seconds="$((now - boot))" - ;; - esac - - days="$((seconds / 60 / 60 / 24)) days" - hours="$((seconds / 60 / 60 % 24)) hours" - minutes="$((seconds / 60 % 60)) minutes" - - case "$days" in - "0 days") unset days ;; - "1 days") days="${days/s}" ;; - esac - - case "$hours" in - "0 hours") unset hours ;; - "1 hours") hours="${hours/s}" ;; - esac - - case "$minutes" in - "0 minutes") unset minutes ;; - "1 minutes") minutes="${minutes/s}" ;; - esac - - uptime="${days:+$days, }${hours:+$hours, }${minutes}" - uptime="${uptime%', '}" - uptime="up ${uptime:-${seconds} seconds}" + # Get current date in seconds + now="$(date +%s)" + seconds="$((now - boot))" ;; "Solaris") - uptime="$(uptime | /usr/xpg4/bin/awk -F ':[0-9]{2}+[a-z][a-z] |(, ){1}+' '{printf $2}')" + seconds="$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}')" + seconds="${seconds/.*}" ;; esac + days="$((seconds / 60 / 60 / 24)) days" + hours="$((seconds / 60 / 60 % 24)) hours" + minutes="$((seconds / 60 % 60)) minutes" + + case "$days" in + "0 days") unset days ;; + "1 days") days="${days/s}" ;; + esac + + case "$hours" in + "0 hours") unset hours ;; + "1 hours") hours="${hours/s}" ;; + esac + + case "$minutes" in + "0 minutes") unset minutes ;; + "1 minutes") minutes="${minutes/s}" ;; + esac + + uptime="${days:+$days, }${hours:+$hours, }${minutes}" + uptime="${uptime%', '}" + uptime="up ${uptime:-${seconds} seconds}" + # Make the output of uptime smaller. case "$uptime_shorthand" in "on") From 24c817ff703aef64571f97d7e969e61410e5d87b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 21:39:36 +1100 Subject: [PATCH 12/17] Changelog --- Changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog.md b/Changelog.md index 94e763e0..c63c1f76 100644 --- a/Changelog.md +++ b/Changelog.md @@ -67,6 +67,9 @@ https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429 **CPU**
+- Expanded `cpu_cores` option by adding two new values, `logical` and `physical`. + - `logical`: Show all virtual cores (hyperthreaded). + - `physical`: Only show physical cores. - [macOS] Print physical cores instead of hyper-threaded cores. **[@iandrewt](https://github.com/iandrewt)** **Resolution**
From 4619eba6546a914ba70e7e5fb71aa9382415e46a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 21:45:32 +1100 Subject: [PATCH 13/17] Don't do any dynamic prompt stuff in image off mode --- neofetch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/neofetch b/neofetch index 2bb72b09..16f6ff54 100755 --- a/neofetch +++ b/neofetch @@ -2901,7 +2901,7 @@ kdeconfigdir() { dynamicprompt() { # Calculate image height in terminal cells. # The '+ 4' adds a gap between the prompt and the content. - [ "$image" != "ascii" ] && [ "$image" != "off" ] && \ + [ "$image" != "ascii" ] && \ lines="$((${height:-1} / ${font_height:-1} + 4))" # If the info is higher than the ascii/image place the prompt @@ -3299,17 +3299,17 @@ main() { # Display the image if enabled displayimage + + # Set cursor position next to ascii art + printf "\033[$((${lines:-4} - ${prompt_loc:-4}))A" + + # Reset horizontal cursor position + printf "\033[9999999D" fi - # Set cursor position next to ascii art - printf "\033[$((${lines:-4} - ${prompt_loc:-4}))A" - - # Reset horizontal cursor position - printf "\033[9999999D" - # Print the info printinfo - dynamicprompt + [ "$image" != "off" ] && dynamicprompt # Re-enable line wrap printf "%b%s" "\033[?7h" From 11283702d2c5479370611f2aa45528cc2594e9ca Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 21:46:29 +1100 Subject: [PATCH 14/17] Changelog --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index c63c1f76..4458121c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,7 @@ - Added new function called `checkoldflags` which informs users about deprecated config options. - Change all `OS X` references to `macOS`. **[@iandrewt](https://github.com/iandrewt)** - Fix corrupted text when long lines are cut-off. +- Don't dynamically place prompt in `image=off` mode. ## Operating System From 6c50efa75b3f8f88abcd1fcadfed80ef24557908 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 21:48:17 +1100 Subject: [PATCH 15/17] term: Don't print output of busybox ps --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 16f6ff54..125c747e 100755 --- a/neofetch +++ b/neofetch @@ -1593,7 +1593,7 @@ getterm() { case "${name// }" in "${SHELL/*\/}" | *"sh" | "tmux"* | "screen") getterm "$parent" ;; "login"* | *"Login"* | "init") term="$(tty)" ;; - "ruby" | "1" | "systemd" | "sshd"* | "python"*) unset term ;; + "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) unset term ;; "gnome-terminal-") term="gnome-terminal" ;; *) term="${name##*/}" ;; esac From b887756ce1585732bde0f1721e32e041ca5628ed Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 21:49:16 +1100 Subject: [PATCH 16/17] Changelog --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 4458121c..3e0f2ad1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -100,6 +100,7 @@ https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429 **Terminal and Terminal Font**
- Uppercase first letter of `term` and `termfont` outputs. +- Don't print broken output of busybox's `ps`. - Remove path from output. **Song**
From 7b281b2a4c2de74df8b04d462d97e77ab9a06d57 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 23:49:16 +1100 Subject: [PATCH 17/17] Changelog --- Changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.md b/Changelog.md index 3e0f2ad1..7764afd9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -73,6 +73,10 @@ https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429 - `physical`: Only show physical cores. - [macOS] Print physical cores instead of hyper-threaded cores. **[@iandrewt](https://github.com/iandrewt)** +**Uptime**
+ +- Rewrote uptime function to use seconds since boot instead of the `uptime` command. + **Resolution**
- [macOS] Add @2x label for retina resolutions. **[@iandrewt](https://github.com/iandrewt)**