Added option to set w3m-img path, Moved usage to a single cat call instead of countless printfs
This commit is contained in:
parent
4dba6f2e09
commit
87c50d46dc
155
fetch.sh
155
fetch.sh
|
@ -155,6 +155,10 @@ images="on"
|
||||||
# Thumbnail directory
|
# Thumbnail directory
|
||||||
imgtempdir="$HOME/.fetchimages"
|
imgtempdir="$HOME/.fetchimages"
|
||||||
|
|
||||||
|
# W3m-img path
|
||||||
|
# Some systems have this in another location
|
||||||
|
w3m_img_path="/usr/lib/w3m/w3mimgdisplay"
|
||||||
|
|
||||||
# Split Size
|
# Split Size
|
||||||
# Sizing for the img and text splits
|
# Sizing for the img and text splits
|
||||||
# The larger the value the less space fetch will take up.
|
# The larger the value the less space fetch will take up.
|
||||||
|
@ -757,80 +761,81 @@ clear="\e[0m"
|
||||||
# Usage {{{
|
# Usage {{{
|
||||||
|
|
||||||
|
|
||||||
usage () {
|
usage () { cat << EOF
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" "usage: ${0##*/} [--colors 1 2 4 5] [--kernel \"\$(uname -rs)\"]"
|
usage: ${0##*/} [--colors 1 2 3 4 5] [--kernel "\$\(uname -rs\)"]
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" " Info:"
|
Info:
|
||||||
printf "%s\n" " --title string Change the title at the top"
|
--title string Change the title at the top
|
||||||
printf "%s\n" " --distro string/cmd Manually set the distro"
|
--distro string/cmd Manually set the distro
|
||||||
printf "%s\n" " --kernel string/cmd Manually set the kernel"
|
--kernel string/cmd Manually set the kernel
|
||||||
printf "%s\n" " --uptime string/cmd Manually set the uptime"
|
--uptime string/cmd Manually set the uptime
|
||||||
printf "%s\n" " --uptime_shorthand on/off --v"
|
--uptime_shorthand on/off --v
|
||||||
printf "%s\n" " Shorten the output of uptime"
|
Shorten the output of uptime
|
||||||
printf "%s\n" " --packages string/cmd Manually set the package count"
|
--packages string/cmd Manually set the package count
|
||||||
printf "%s\n" " --shell string/cmd Manually set the shell"
|
--shell string/cmd Manually set the shell
|
||||||
printf "%s\n" " --winman string/cmd Manually set the window manager"
|
--winman string/cmd Manually set the window manager
|
||||||
printf "%s\n" " --use_wmctrl on/off Use wmctrl for a more accurate reading"
|
--use_wmctrl on/off Use wmctrl for a more accurate reading
|
||||||
printf "%s\n" " --cpu string/cmd Manually set the cpu name"
|
--cpu string/cmd Manually set the cpu name
|
||||||
printf "%s\n" " --memory string/cmd Manually set the memory"
|
--memory string/cmd Manually set the memory
|
||||||
printf "%s\n" " --speed_type Change the type of cpu speed to get"
|
--speed_type Change the type of cpu speed to get
|
||||||
printf "%s\n" " Possible values: current, min, max"
|
Possible values: current, min, max
|
||||||
printf "%s\n" " --song string/cmd Manually set the current song"
|
--song string/cmd Manually set the current song
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" " Text Colors:"
|
Text Colors:
|
||||||
printf "%s\n" " --colors 1 2 3 4 5 Change the color of text"
|
--colors 1 2 3 4 5 Change the color of text
|
||||||
printf "%s\n" " (title, subtitle, colon, underline, info)"
|
(title, subtitle, colon, underline, info)
|
||||||
printf "%s\n" " --title_color num Change the color of the title"
|
--title_color num Change the color of the title
|
||||||
printf "%s\n" " --subtitle_color num Change the color of the subtitle"
|
--subtitle_color num Change the color of the subtitle
|
||||||
printf "%s\n" " --colon_color num Change the color of the colons"
|
--colon_color num Change the color of the colons
|
||||||
printf "%s\n" " --underline_color num Change the color of the underlines"
|
--underline_color num Change the color of the underlines
|
||||||
printf "%s\n" " --info_color num Change the color of the info"
|
--info_color num Change the color of the info
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" " Text Formatting:"
|
Text Formatting:
|
||||||
printf "%s\n" " --underline on/off Enable/Disable title underline"
|
--underline on/off Enable/Disable title underline
|
||||||
printf "%s\n" " --underline_char char Character to use when underlineing title"
|
--underline_char char Character to use when underlineing title
|
||||||
printf "%s\n" " --line_wrap on/off Enable/Disable line wrapping"
|
--line_wrap on/off Enable/Disable line wrapping
|
||||||
printf "%s\n" " --bold on/off Enable/Disable bold text"
|
--bold on/off Enable/Disable bold text
|
||||||
printf "%s\n" " --prompt_height num Set this to your prompt height to fix"
|
--prompt_height num Set this to your prompt height to fix
|
||||||
printf "%s\n" " issues with the text going off screen at the top"
|
issues with the text going off screen at the top
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" " Color Blocks:"
|
Color Blocks:
|
||||||
printf "%s\n" " --color_blocks on/off Enable/Disable the color blocks"
|
--color_blocks on/off Enable/Disable the color blocks
|
||||||
printf "%s\n" " --block_width num Width of color blocks"
|
--block_width num Width of color blocks
|
||||||
printf "%s\n" " --block_range start end --v "
|
--block_range start end --v
|
||||||
printf "%s\n" " Range of colors to print as blocks"
|
Range of colors to print as blocks
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" " Image:"
|
Image:
|
||||||
printf "%s\n" " --image Image to display with the script"
|
--image Image to display with the script
|
||||||
printf "%s\n" " The image gets priority over other"
|
The image gets priority over other
|
||||||
printf "%s\n" " images: (wallpaper, \$img)"
|
images: (wallpaper, \$img)
|
||||||
printf "%s\n" " --font_width px Used to automatically size the image"
|
--font_width px Used to automatically size the image
|
||||||
printf "&s\n" " --image_position Where to display the image: (Left/Right)"
|
--image_position Where to display the image: (Left/Right)
|
||||||
printf "%s\n" " --split_size num Width of img/text splits"
|
--split_size num Width of img/text splits
|
||||||
printf "%s\n" " A value of 2 makes each split half the terminal"
|
A value of 2 makes each split half the terminal
|
||||||
printf "%s\n" " width and etc"
|
width and etc
|
||||||
printf "%s\n" " --crop_mode Which crop mode to use"
|
--crop_mode Which crop mode to use
|
||||||
printf "%s\n" " Takes the values: normal, fit, fill"
|
Takes the values: normal, fit, fill
|
||||||
printf "%s\n" " --crop_offset value Change the crop offset for normal mode."
|
--crop_offset value Change the crop offset for normal mode.
|
||||||
printf "%s\n" " Possible values: northwest, north, northeast,"
|
Possible values: northwest, north, northeast,
|
||||||
printf "%s\n" " west, center, east, southwest, south, southeast"
|
west, center, east, southwest, south, southeast
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" " --xoffset px How close the image will be "
|
--xoffset px How close the image will be
|
||||||
printf "%s\n" " to the left edge of the window"
|
to the left edge of the window
|
||||||
printf "%s\n" " --yoffset px How close the image will be "
|
--yoffset px How close the image will be
|
||||||
printf "%s\n" " to the top edge of the window"
|
to the top edge of the window
|
||||||
printf "%s\n" " --gap num Gap between image and text right side"
|
--gap num Gap between image and text right side
|
||||||
printf "%s\n" " to the top edge of the window"
|
to the top edge of the window
|
||||||
printf "%s\n" " --images on/off Enable/Disable all images"
|
--images on/off Enable/Disable all images
|
||||||
printf "%s\n" " --wall on/off Enable/Disable the wallpaper function"
|
--wall on/off Enable/Disable the wallpaper function
|
||||||
printf "%s\n" " and fallback to \$img"
|
and fallback to \$img
|
||||||
printf "%s\n" " --clean Remove all cropped images"
|
--clean Remove all cropped images
|
||||||
printf "%s\n"
|
|
||||||
printf "%s\n" " Other:"
|
Other:
|
||||||
printf "%s\n" " --help Print this text and exit"
|
--help Print this text and exit
|
||||||
printf "%s\n"
|
|
||||||
exit 1
|
EOF
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1004,7 +1009,7 @@ printinfo
|
||||||
|
|
||||||
# Display the image
|
# Display the image
|
||||||
[ "$images" == "on" ] && printf "0;1;$xoffset;$yoffset;$imgsize;$imgsize;;;;;"$img"\n4;\n3;" |\
|
[ "$images" == "on" ] && printf "0;1;$xoffset;$yoffset;$imgsize;$imgsize;;;;;"$img"\n4;\n3;" |\
|
||||||
/usr/lib/w3m/w3mimgdisplay
|
$w3m_img_path
|
||||||
|
|
||||||
# Enable line wrap again
|
# Enable line wrap again
|
||||||
[ $line_wrap == "off" ] && printf '\e[?7h'
|
[ $line_wrap == "off" ] && printf '\e[?7h'
|
||||||
|
|
Reference in New Issue