From 60beb88def160de6568f28fca7da02ea42f46aa1 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Oct 2016 01:14:02 +1100 Subject: [PATCH] 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