Image: Added --loop flag.

This commit is contained in:
Dylan Araps 2017-04-26 07:39:10 +10:00
parent eeaae2d554
commit a1d87ea105
3 changed files with 18 additions and 0 deletions

View file

@ -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'

View file

@ -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
}

View file

@ -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