From 1948f0e4ffbd087f07c07948b27962cb6b895932 Mon Sep 17 00:00:00 2001 From: Matthew Cox Date: Tue, 25 Apr 2017 19:36:49 +0100 Subject: [PATCH 1/6] Fix termite font matching Each config parameter is allowed arbitrary whitespace before it. It took me a long time to work out why it was always returning the /etc/xdg/termite/config value! --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 0ffba95b..83fa6718 100755 --- a/neofetch +++ b/neofetch @@ -1756,7 +1756,7 @@ get_term_font() { "termite") [[ -f "${XDG_CONFIG_HOME}/termite/config" ]] && termite_config="${XDG_CONFIG_HOME}/termite/config" - term_font="$(awk -F '= ' '/\[options\]/ {opt=1} /^font/ {if(opt==1) a=$2; opt=0} END{print a}' "/etc/xdg/termite/config" "$termite_config")" + term_font="$(awk -F '= ' '/\[options\]/ {opt=1} /^\s*font/ {if(opt==1) a=$2; opt=0} END{print a}' "/etc/xdg/termite/config" "$termite_config")" ;; "urxvt" | "urxvtd" | "rxvt-unicode" | "xterm") From eeaae2d5543005e537fb91e13c11d61657a1c9ab Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 26 Apr 2017 07:29:05 +1000 Subject: [PATCH 2/6] Docs: CHANGELOG --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9652019..65157d9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,11 @@ ## Contributors +- **[@MatthewCox](https://github.com/MatthewCox)** + + +## Info + +**Terminal Emulator** + +- [Termite] Fix font mismatch. **[@MatthewCox](https://github.com/MatthewCox)** + From a1d87ea105e8ec9dc236cfcb3e3f2e0418ded645 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 26 Apr 2017 07:39:10 +1000 Subject: [PATCH 3/6] Image: Added --loop flag. --- config/config | 10 ++++++++++ neofetch | 5 +++++ neofetch.1 | 3 +++ 3 files changed, 18 insertions(+) diff --git a/config/config b/config/config index 6237ccd9..baaf7d38 100644 --- a/config/config +++ b/config/config @@ -540,6 +540,7 @@ disk_display="off" # Backend Settings + # Image backend. # # Default: 'ascii' @@ -602,6 +603,15 @@ ascii_bold="on" # Image Options +# Image loop +# Setting this to on will make neofetch redraw the image constantly until +# Ctrl+C is pressed. This fixes display issues in some terminal emulators. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --loop +image_loop="off" + # Thumbnail directory # # Default: '~/.cache/thumbnails/neofetch' diff --git a/neofetch b/neofetch index 83fa6718..491da0f3 100755 --- a/neofetch +++ b/neofetch @@ -3967,6 +3967,7 @@ ASCII: Possible values: bar, infobar, barinfo, off IMAGE: + --loop Redraw the image constantly until Ctrl+C is used. This fixes issues in some terminals emulators when using image mode. --size 00px | --size 00% How to size the image. Possible values: auto, 00px, 00%, none --crop_mode mode Which crop mode to use @@ -4151,6 +4152,7 @@ get_args() { ;; # Image options + "--loop") image_loop="on" ;; "--image_size" | "--size") image_size="$2" ;; "--crop_mode") crop_mode="$2" ;; "--crop_offset") crop_offset="$2" ;; @@ -4255,6 +4257,9 @@ main() { # Show error messages. [[ "$verbose" == "on" ]] && printf "%b" "$err" >&2 + # If `--loop` was used, constantly redraw the image. + while [[ "$image_loop" == "on" && "$image_backend" == "w3m" ]]; do display_image; sleep 1s; done + return 0 } diff --git a/neofetch.1 b/neofetch.1 index c803bfd1..aa7d418b 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -247,6 +247,9 @@ Hide the info text and only show the ascii logo. Possible values: bar, infobar, barinfo, off .SS "IMAGE:" .TP +\fB\-\-loop\fR +Redraw the image constantly until Ctrl+C is used. This fixes issues in some terminals emulators when using image mode. +.TP \fB\-\-size\fR 00px | \fB\-\-size\fR 00% How to size the image. Possible values: auto, 00px, 00%, none From 04cf863f7870a85816437bf07a78d68e96e2150b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 26 Apr 2017 07:42:01 +1000 Subject: [PATCH 4/6] Docs: Changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65157d9d..172881aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ - **[@MatthewCox](https://github.com/MatthewCox)** +## Images + +- [w3m] Added `--loop` flag which makes Neofetch draw the image once per second. + - This is a workaround to the images disappearing on resize and workspace switch. + - Use Ctrl+C to exit. + + ## Info **Terminal Emulator** From 74e8facfe274b275a50bba57d96523eb7e963ded Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 26 Apr 2017 08:12:35 +1000 Subject: [PATCH 5/6] GPU: Correctly filter out duplicate GPU names. --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 491da0f3..938f0b96 100755 --- a/neofetch +++ b/neofetch @@ -1071,7 +1071,7 @@ get_gpu() { "Linux") # Read GPUs into array. IFS=$'\n' - gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '!a[$0]++ && /"Display|"3D|"VGA/ {print $3 " " $4}')) + gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}' | sort -u)) IFS="$old_ifs" # Number the GPUs if more than one exists. From 781a0fff9bdd46417776b6aa4d70c9fefb44ad79 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 26 Apr 2017 08:13:31 +1000 Subject: [PATCH 6/6] Docs: CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 172881aa..2195b801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,3 +16,6 @@ - [Termite] Fix font mismatch. **[@MatthewCox](https://github.com/MatthewCox)** +**GPU** + +- [Linux] Fixed GPU sort.