From fb7b3c146ea9287e354fad7300398a3ea514b4e9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 10:00:09 +1100 Subject: [PATCH 01/30] 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/30] 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/30] 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/30] 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/30] 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/30] 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/30] 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/30] 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/30] 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/30] 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/30] 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 c804f7835e33b27a3714c711cb80f6a3e42395b3 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 21:25:43 +1100 Subject: [PATCH 12/30] Image mode: Add support for terminal emulators that don't support \033[14t --- README.md | 35 +++++++++++++++----------- neofetch | 73 +++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 71 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 5dcf1af3..b6a8c9f2 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,21 @@ Have a look at the wiki, I've updated/added some new pages!
- Alpine Linux: You also need `ncurses`. +##### Image mode + +These dependencies are required for image mode to work. + +- Displaying images: `w3m-img` \[1\] or `iTerm2` or `Terminology` \[2\] +- Thumbnail creation: `imagemagick` +- Window size: A terminal emulator that supports `\033[14t` \[3\] or `xdotool` or `xwininfo + xprop` or `xwininfo + xdpyinfo` + +\[1\] `w3m-img` is sometimes bundled together with `w3m`. + +\[2\] Image support is built into Terminology and iTerm2, and doesn't require w3m-img. + +\[3\] See this wiki page to find out if your terminal emulator supports `\033[14t` or if you need an additonal dependency. + + ##### iOS These dependencies can all be installed through Cydia.
@@ -99,19 +114,18 @@ Note: The cydia package installs these dependencies for you. - `Gawk` - `grep` + ### Optional dependencies: -- Desktop Environment and Window Manager: `xprop` \[1\] -- Displaying images: `w3m-img` \[2\] \[3\] or `iTerm2` or `Terminology` \[4\] -- Thumbnail creation: `imagemagick` - Displaying song information from Google Play Music Desktop Player: [`gpmdp-remote`](https://github.com/iAndrewT/gpmdp-remote) +- Desktop Environment and Window Manager: `xprop` \[1\] ##### Linux / BSD / Solaris - Wallpaper: `feh`, `nitrogen` or `gsettings` - Current Song: `mpc`, `cmus`, `moc`, `spotify`, `gpmdc` -- Resolution: `xorg-xrandr` or `xorg-xdpyinfo` \[5\] -- Screenshot: `scrot` \[6\] +- Resolution: `xorg-xrandr` or `xorg-xdpyinfo` \[2\] +- Screenshot: `scrot` \[3\] ##### OSX @@ -128,17 +142,10 @@ Note: The cydia package installs these dependencies for you. \[1\] See **[#79](https://github.com/dylanaraps/neofetch/issues/79)** about why this is now a required dependency. -\[2\] `w3m-img` is sometimes bundled together with `w3m`. - -\[3\] Image support only works in certain terminal emulators. The script will fallback to ascii mode on
-terminal emulators that don't support the xterm escape sequences we're using for image sizing. - -\[4\] Image support is built into Terminology and iTerm2, and doesn't require w3m-img. - -\[5\] Xrandr is prefered over xdpyinfo as Xrandr supports multi monitor and refresh rate display in the
+\[2\] Xrandr is prefered over xdpyinfo as Xrandr supports multi monitor and refresh rate display in the
output. -\[6\] You can use the launch flag `--scrot_cmd` or change the config option `$scrot_cmd` to your screenshot
+\[3\] You can use the launch flag `--scrot_cmd` or change the config option `$scrot_cmd` to your screenshot
program's cmd and neofetch will use it instead of scrot. diff --git a/neofetch b/neofetch index 5b9cf92a..24d08f90 100755 --- a/neofetch +++ b/neofetch @@ -2098,39 +2098,66 @@ getimage() { esac # Get terminal width and height - if [ -n "$TMUX" ]; then - printf "%b%s" "\033Ptmux;\033\033[14t\033\033[c\033\\" - read_flags="-d c" + if type -p xdotool >/dev/null 2>&1 && \ + [ "$image_backend" != "iterm2" ]; then - elif [ "$image_backend" == "tycat" ]; then - printf "%b%s" "\033}qs\000" + current_window="$(xdotool getactivewindow)" + eval "$(xdotool getwindowgeometry --shell "$current_window")" + term_height="$HEIGHT" + term_width="$WIDTH" + + elif type -p xwininfo >/dev/null 2>&1 && \ + type -p xdpyinfo >/dev/null 2>&1 || \ + type -p xprop >/dev/null 2>&1 && \ + [ "$image_backend" != "iterm2" ]; then + + if type -p xdpyinfo >/dev/null 2>&1; then + current_window="$(xdpyinfo | grep focus | grep -E -o 0x[0-9a-f]+)" + elif type -p xprop >/dev/null 2>&1; then + current_window="$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" + fi + + term_size="$(xwininfo -id "$current_window" | awk -F ': ' '/Width|Height/ {printf $2 " "}')" + term_width="${term_size/ *}" + term_height="${term_size/${term_width}}" else - printf "%b%s" "\033[14t\033[c" - read_flags="-d c" - fi + if [ -n "$TMUX" ]; then + printf "%b%s" "\033Ptmux;\033\033[14t\033\033[c\033\\" + read_flags="-d c" - # The escape code above prints the output AFTER the prompt so this - builtin read -s -t 1 ${read_flags} -r term_size + elif [ "$image_backend" == "tycat" ]; then + printf "%b%s" "\033}qs\000" - # Split the string - if [ "$image_backend" == "tycat" ]; then - term_size=(${term_size//;/ }) - term_width="$((term_size[2] * term_size[0]))" - term_height="$((term_size[3] * term_size[1]))" + else + printf "%b%s" "\033[14t\033[c" + read_flags="-d c" + fi - else - term_size="${term_size//'['}" - term_size="${term_size/';'}" - term_size="${term_size/$'\E4'}" - term_size="${term_size/t*}" - term_height="${term_size/';'*}" - term_width="${term_size/*';'}" + # The escape code above prints the output AFTER the prompt so this + builtin read -s -t 1 ${read_flags} -r term_size + + # Split the string + if [ "$image_backend" == "tycat" ]; then + term_size=(${term_size//;/ }) + term_width="$((term_size[2] * term_size[0]))" + term_height="$((term_size[3] * term_size[1]))" + + else + term_size="${term_size//'['}" + term_size="${term_size/';'}" + term_size="${term_size/$'\E4'}" + term_size="${term_size/t*}" + term_height="${term_size/';'*}" + term_width="${term_size/*';'}" + fi + + [ "${#term_size}" -le 5 ] && no_esc="1" fi # If $img isn't a file or the terminal doesn't support xterm escape sequences, # fallback to ascii mode. - if [ ! -f "$img" ] || ([ "${#term_size}" -le 5 ] && [ "$image_backend" != "tycat" ]); then + if [ ! -f "$img" ] || ([ "$no_esc" == 1 ] && [ "$image_backend" != "tycat" ]); then image="ascii" getascii From 24c817ff703aef64571f97d7e969e61410e5d87b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 21 Oct 2016 21:39:36 +1100 Subject: [PATCH 13/30] 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 14/30] 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 15/30] 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 16/30] 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 17/30] 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 18/30] 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)** From 76f7b4025ea6b6b3df8b8e07c3b971d3b0da827e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 00:06:51 +1100 Subject: [PATCH 19/30] w3m-img: Draw the image twice --- neofetch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neofetch b/neofetch index 8fe058b5..9f862f8b 100755 --- a/neofetch +++ b/neofetch @@ -3317,6 +3317,10 @@ main() { printinfo [ "$image" != "off" ] && dynamicprompt + # w3m-img: Draw the image a second time to fix + # rendering issues in specific terminal emulators. + [ "$image_backend" == "w3m" ] && displayimage + # Re-enable line wrap printf "%b%s" "\033[?7h" From a564b19aeb546a5c8b9726267f4944bf3d5a629c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 00:42:34 +1100 Subject: [PATCH 20/30] Fix cursor bugs and use yoffset in calculations --- neofetch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index 9f862f8b..db55e25a 100755 --- a/neofetch +++ b/neofetch @@ -2906,25 +2906,25 @@ kdeconfigdir() { dynamicprompt() { # Calculate image height in terminal cells. - # The '+ 4' adds a gap between the prompt and the content. + # The '+ 1' adds a gap between the prompt and the content. [ "$image" != "ascii" ] && \ - lines="$((${height:-1} / ${font_height:-1} + 4))" + lines="$((${height:-1} / ${font_height:-1} + 1))" # If the info is higher than the ascii/image place the prompt # based on the info height instead of the ascii/image height. if [ "${lines:-0}" -lt "${info_height:-0}" ]; then lines="0" else - lines="$((lines - info_height - 4))" + lines="$((lines - info_height + $((${yoffset:-1} / ${font_height:-1}))))" fi # Set the prompt location [ "$image" != "off" ] && printf "\033[${lines/-*/0}B" - # Add some padding if the lines are above 0 - if [ "$lines" -gt 0 ]; then + # Add some padding + [ "$image_backend" != "w3m" ] && \ + [ "$lines" -gt 0 ] && \ printf "\n\n" - fi } # }}} From 466a61b19e2693dd65a5b726e9788b23217f6a2d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 00:54:09 +1100 Subject: [PATCH 21/30] Changelog --- Changelog.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Changelog.md b/Changelog.md index 7764afd9..51a819d4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -42,6 +42,21 @@ The final fix was as simple as adding a zero-width space before the info, here's https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429af39d9 +**Removed hard dependency on `\033[14t`** + +Neofetch no longer requires a terminal emulator that supports `\033[14t` this means that neofetch now works in Konsole. Instead of using the escape sequence users now have three options for getting the terminal size in pixels. + +- `xdotool` +- `xwininfo` + `xprop` +- `xwininfo` + `xdpyinfo` + +Neofetch will detect whatever combination you have insalled and use these programs. + +Note: `\033[14t` is still supported, if images already work for you then you don't have to install anything else. + +- [w3m-img] Draw the image twice to fix rendering issues in Konsole. +- [w3m-img] Fix cursor position when using `yoffset`. + ## Ascii From b12e5b1f569898e91c0a2d3887d3fdd2111fb488 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:05:47 +1100 Subject: [PATCH 22/30] Fix yoffset bug --- neofetch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index db55e25a..e968807e 100755 --- a/neofetch +++ b/neofetch @@ -2907,15 +2907,17 @@ kdeconfigdir() { dynamicprompt() { # Calculate image height in terminal cells. # The '+ 1' adds a gap between the prompt and the content. - [ "$image" != "ascii" ] && \ - lines="$((${height:-1} / ${font_height:-1} + 1))" + if [ "$image" != "ascii" ]; then + lines="$((${height:-1} / ${font_height:-1} + 2))" + cursor_yoffset="$((${yoffset:-1} / ${font_height:-1}))" + fi # If the info is higher than the ascii/image place the prompt # based on the info height instead of the ascii/image height. if [ "${lines:-0}" -lt "${info_height:-0}" ]; then lines="0" else - lines="$((lines - info_height + $((${yoffset:-1} / ${font_height:-1}))))" + lines="$((lines - info_height + cursor_yoffset - 1))" fi # Set the prompt location From 60beb88def160de6568f28fca7da02ea42f46aa1 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:14:02 +1100 Subject: [PATCH 23/30] w3m-img: Add -bg support --- README.md | 2 ++ neofetch | 5 ++++- neofetch.1 | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ab0e7a3..24742bf4 100644 --- a/README.md +++ b/README.md @@ -440,6 +440,8 @@ alias neofetch2="neofetch \ window. This only works with w3m. --yoffset px How close the image will be to the top edge of the window. This only works with w3m. + --bg_color color Background color to display behind transparent image. + This only works with w3m. --gap num Gap between image and text. NOTE: --gap can take a negative value which will move the text closer to the left side. diff --git a/neofetch b/neofetch index e968807e..8911377b 100755 --- a/neofetch +++ b/neofetch @@ -2312,7 +2312,7 @@ displayimage() { # appearing in specific terminal emulators. sleep 0.05 printf "%b%s\n" "0;1;$xoffset;$yoffset;$width;$height;;;;;$img\n4;\n3;" |\ - $w3m_img_path 2>/dev/null || padding="\033[0C" + $w3m_img_path -bg "$background_color" 2>/dev/null || padding="\033[0C" ;; "iterm2") @@ -3037,6 +3037,8 @@ usage() { cat << EOF window. This only works with w3m. --yoffset px How close the image will be to the top edge of the window. This only works with w3m. + --bg_color color Background color to display behind transparent image. + This only works with w3m. --gap num Gap between image and text. NOTE: --gap can take a negative value which will move the text closer to the left side. @@ -3176,6 +3178,7 @@ getargs() { --crop_offset) crop_offset="$2" ;; --xoffset) xoffset="$2" ;; --yoffset) yoffset="$2" ;; + --background_color | --bg_color) background_color="$2" ;; --gap) gap="$2" ;; --clean) rm -rf "$thumbnail_dir" diff --git a/neofetch.1 b/neofetch.1 index 62e3cd62..62d98dd4 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -198,6 +198,10 @@ window in pixel. This only works with w3m. How close the image will be to the top edge of the window. This only works with w3m. .TP +.B \--bg_color 'color' +Background color to display behind transparent image. +This only works with w3m. +.TP .B \--gap 'num' Gap between image and text. .br From 13cb444d75a83079896065fe4ec3c5e780c372db Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:16:22 +1100 Subject: [PATCH 24/30] Changelog --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 51a819d4..d212f3d2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -56,6 +56,8 @@ Note: `\033[14t` is still supported, if images already work for you then you don - [w3m-img] Draw the image twice to fix rendering issues in Konsole. - [w3m-img] Fix cursor position when using `yoffset`. +- [w3m-img] Add `-bg` support with the new option `--bg_color`. + - `neofetch --bg_color blue` will make the background behind the image blue. ## Ascii From 411b7d3b8b5fba462ca013ddb11fcb9621466400 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:18:04 +1100 Subject: [PATCH 25/30] Add config option for bg_color --- config/config | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/config b/config/config index 605ed6bd..e55f6ac3 100644 --- a/config/config +++ b/config/config @@ -304,11 +304,12 @@ image="wall" thumbnail_dir="$HOME/.cache/thumbnails/neofetch" # W3m-img path +# Only works with the w3m backend. # Some systems have this in another location w3m_img_path="/usr/lib/w3m/w3mimgdisplay" # Image position -# Only works with the w3m backend +# Only works with the w3m backend. # --image_position left/right image_position="left" @@ -332,11 +333,18 @@ image_size="auto" gap=2 # Image offsets +# Only works with the w3m backend. # --xoffset px # --yoffset px yoffset=0 xoffset=0 +# Image background color +# Only works with the w3m backend. +# Unset by default. +# --bg_color 'color', blue +background_color= + # }}} From bcb51ee7aae96ce50dacbe10e1d75ae9d7277531 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:27:39 +1100 Subject: [PATCH 26/30] Add more deprecated flags to checkoldflags() --- neofetch | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/neofetch b/neofetch index 8911377b..693c12ee 100755 --- a/neofetch +++ b/neofetch @@ -1996,7 +1996,7 @@ getwallpaper() { [ "${img/*\./}" == "xml" ] && img="" # Error msg - [ -z "$img" ] && err "Wallpaper detection failed, falling back to ascii mode." + [ -z "$img" ] && err "Image: Wallpaper detection failed, falling back to ascii mode." } # }}} @@ -2007,7 +2007,7 @@ getascii() { if [ ! -f "$ascii" ] || [ "$ascii" == "distro" ]; then # Error message [ "$ascii" != "distro" ] && \ - [ ! -f "$ascii" ] && err "Ascii file not found, using distro ascii" + [ ! -f "$ascii" ] && err "Ascii: Ascii file not found, using distro ascii" # Lowercase the distro name if [ "$version" -le 3 ]; then @@ -2034,7 +2034,7 @@ getascii() { if [ ! -f "$script_dir/ascii/distro/${ascii/ *}" ]; then padding="\033[0C" image="off" - err "Ascii file not found, falling back to text mode." + err "Ascii: Ascii file not found, falling back to text mode." return fi @@ -2153,8 +2153,8 @@ getimage() { getascii # Error messages - [ ! -f "$img" ] && err "\$img, isn't a file, falling back to ascii mode." - [ "${#term_size}" -le 5 ] && err "Your terminal doesn't support \\\033[14t, falling back to ascii mode." + [ ! -f "$img" ] && err "Image: \$img, isn't a file, falling back to ascii mode." + [ "${#term_size}" -le 5 ] && err "Image: Your terminal doesn't support \\\033[14t, falling back to ascii mode." return else @@ -2296,7 +2296,7 @@ getw3m_img_path() { else image="ascii" - err "w3m-img wasn't found on your system, falling back to ascii mode." + err "Image: w3m-img wasn't found on your system, falling back to ascii mode." fi } @@ -2761,8 +2761,10 @@ err() { # Check for old flags {{{ checkoldflags() { - [ -n "$osx_buildversion" ] && err "\$osx_buildversion is deprecated, use \$distro_shorthand instead." - [ -n "$osx_codename" ] && err "\$osx_codename is deprecated, use \$distro_shorthand instead." + [ -n "$osx_buildversion" ] && err "Config: \$osx_buildversion is deprecated, use \$distro_shorthand instead." + [ -n "$osx_codename" ] && err "Config: \$osx_codename is deprecated, use \$distro_shorthand instead." + [ -n "$progress_char" ] && err "Config: \$progress_char is deprecated, use \$progress_char_elapsed and \$progress_char_total instead." + [ "$cpu_cores" == "on" ] && err "Config: \$cpu_cores='on' is deprecated, use \$cpu_cores='logical|physical|off' instead." } # }}} @@ -2804,9 +2806,9 @@ getdefaultconfig() { fi if source "$default_config"; then - err "Sourced default config ($default_config)" + err "Config: Sourced default config ($default_config)" else - err "Default config not found, continuing..." + err "Config: Default config not found, continuing..." fi } @@ -2818,7 +2820,7 @@ getuserconfig() { # Check $config_file if [ -f "$config_file" ]; then source "$config_file" - err "Sourced user config ($config_file)" + err "Config: Sourced user config ($config_file)" return fi mkdir -p "$XDG_CONFIG_HOME/neofetch/" @@ -2844,7 +2846,7 @@ getuserconfig() { fi source "$config_file" - err "Sourced user config ($config_file)" + err "Config: Sourced user config ($config_file)" } # }}} From 8c35c005085a36c27f301d2fcd9066b611e0ee85 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:29:38 +1100 Subject: [PATCH 27/30] Changelog --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index d212f3d2..9ec866a1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -93,6 +93,7 @@ Note: `\033[14t` is still supported, if images already work for you then you don **Uptime**
- Rewrote uptime function to use seconds since boot instead of the `uptime` command. + - Every OS/Distro now has the pretty `uptime -p` output! **Resolution**
From 0ebc14dcd08d81df88d685d4b061a01a998fe0bf Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:30:15 +1100 Subject: [PATCH 28/30] Changelog --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 9ec866a1..790cb8c3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -58,6 +58,7 @@ Note: `\033[14t` is still supported, if images already work for you then you don - [w3m-img] Fix cursor position when using `yoffset`. - [w3m-img] Add `-bg` support with the new option `--bg_color`. - `neofetch --bg_color blue` will make the background behind the image blue. + - Note: The background color is only visible behind transparent parts of the image. ## Ascii From a34d64b43b75ff5da775523d95d6bf27d11ef4b8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:35:28 +1100 Subject: [PATCH 29/30] Revert color blocks change as it caused issues in tty --- config/config | 2 +- neofetch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config b/config/config index e55f6ac3..18b52af9 100644 --- a/config/config +++ b/config/config @@ -236,7 +236,7 @@ underline_char="-" # Color block range # --block_range start end start=0 -end=15 +end=7 # Toggle color blocks # --color_blocks on/off diff --git a/neofetch b/neofetch index 693c12ee..134237f1 100755 --- a/neofetch +++ b/neofetch @@ -2919,7 +2919,7 @@ dynamicprompt() { if [ "${lines:-0}" -lt "${info_height:-0}" ]; then lines="0" else - lines="$((lines - info_height + cursor_yoffset - 1))" + lines="$((lines - info_height + cursor_yoffset))" fi # Set the prompt location From 816daba26c3b4c7126d4d53bafea0772ed7bac60 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:35:43 +1100 Subject: [PATCH 30/30] Changelog --- Changelog.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 790cb8c3..561598b2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -118,7 +118,6 @@ Note: `\033[14t` is still supported, if images already work for you then you don - Fixed `block_width` not working. - Fixed `% s` appearing in color blocks when neofetch is run from `tty` - Fixed `block_width` being off by one. A value of `2` made the blocks `3` wide instead of `2` wide. -- Show 16 colors by default instead of 8. **Terminal and Terminal Font**