Commit 60beb88d authored by Dylan Araps's avatar Dylan Araps

w3m-img: Add -bg support

parent b12e5b1f
...@@ -440,6 +440,8 @@ alias neofetch2="neofetch \ ...@@ -440,6 +440,8 @@ alias neofetch2="neofetch \
window. This only works with w3m. window. This only works with w3m.
--yoffset px How close the image will be to the top edge of the --yoffset px How close the image will be to the top edge of the
window. This only works with w3m. 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. --gap num Gap between image and text.
NOTE: --gap can take a negative value which will NOTE: --gap can take a negative value which will
move the text closer to the left side. move the text closer to the left side.
......
...@@ -2312,7 +2312,7 @@ displayimage() { ...@@ -2312,7 +2312,7 @@ displayimage() {
# appearing in specific terminal emulators. # appearing in specific terminal emulators.
sleep 0.05 sleep 0.05
printf "%b%s\n" "0;1;$xoffset;$yoffset;$width;$height;;;;;$img\n4;\n3;" |\ 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") "iterm2")
...@@ -3037,6 +3037,8 @@ usage() { cat << EOF ...@@ -3037,6 +3037,8 @@ usage() { cat << EOF
window. This only works with w3m. window. This only works with w3m.
--yoffset px How close the image will be to the top edge of the --yoffset px How close the image will be to the top edge of the
window. This only works with w3m. 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. --gap num Gap between image and text.
NOTE: --gap can take a negative value which will NOTE: --gap can take a negative value which will
move the text closer to the left side. move the text closer to the left side.
...@@ -3176,6 +3178,7 @@ getargs() { ...@@ -3176,6 +3178,7 @@ getargs() {
--crop_offset) crop_offset="$2" ;; --crop_offset) crop_offset="$2" ;;
--xoffset) xoffset="$2" ;; --xoffset) xoffset="$2" ;;
--yoffset) yoffset="$2" ;; --yoffset) yoffset="$2" ;;
--background_color | --bg_color) background_color="$2" ;;
--gap) gap="$2" ;; --gap) gap="$2" ;;
--clean) --clean)
rm -rf "$thumbnail_dir" rm -rf "$thumbnail_dir"
......
...@@ -198,6 +198,10 @@ window in pixel. This only works with w3m. ...@@ -198,6 +198,10 @@ window in pixel. This only works with w3m.
How close the image will be to the top edge How close the image will be to the top edge
of the window. This only works with w3m. of the window. This only works with w3m.
.TP .TP
.B \--bg_color 'color'
Background color to display behind transparent image.
This only works with w3m.
.TP
.B \--gap 'num' .B \--gap 'num'
Gap between image and text. Gap between image and text.
.br .br
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment