commit
8d65b36e61
4 changed files with 27 additions and 51 deletions
29
README.md
29
README.md
|
@ -335,7 +335,6 @@ Here's what my fetch alias looks like:
|
||||||
```sh
|
```sh
|
||||||
alias fetch2="fetch \
|
alias fetch2="fetch \
|
||||||
--block_range 1 8 \
|
--block_range 1 8 \
|
||||||
--line_wrap off \
|
|
||||||
--bold off \
|
--bold off \
|
||||||
--uptime_shorthand on \
|
--uptime_shorthand on \
|
||||||
--gtk_shorthand on \
|
--gtk_shorthand on \
|
||||||
|
@ -395,7 +394,6 @@ alias fetch2="fetch \
|
||||||
title, @, underline, subtitle, colon, info
|
title, @, underline, subtitle, colon, info
|
||||||
--underline on/off enable/disable the underline.
|
--underline on/off enable/disable the underline.
|
||||||
--underline_char char Character to use when underlining title
|
--underline_char char Character to use when underlining title
|
||||||
--line_wrap on/off Enable/Disable line wrapping
|
|
||||||
--bold on/off Enable/Disable bold text
|
--bold on/off Enable/Disable bold text
|
||||||
|
|
||||||
|
|
||||||
|
@ -518,33 +516,6 @@ know where it's stored then adding support won't be a problem!<br \>
|
||||||
## Issues and Workarounds
|
## Issues and Workarounds
|
||||||
|
|
||||||
|
|
||||||
#### The text is too long for my terminal window and wraps to the next line
|
|
||||||
|
|
||||||
There are a few ways to fix this.
|
|
||||||
|
|
||||||
* Disable line wrapping with `line_wrap=off` in the script or with the launch flag `--line_wrap off`
|
|
||||||
* The uptime and gtk info lines each have a shorthand option that makes their output smaller. You can <br \>
|
|
||||||
enable them by changing these variables or using these flags.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Config options
|
|
||||||
uptime_shorthand="on"
|
|
||||||
gtk_shorthand="on"
|
|
||||||
gpu_shorthand="on"
|
|
||||||
birthday_shorthand="on"
|
|
||||||
|
|
||||||
# Launch flags
|
|
||||||
--uptime_shorthand on
|
|
||||||
--gtk_shorthand on
|
|
||||||
--gpu_shorthand on
|
|
||||||
--birthday_shorthand on
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
* Edit the config to make the subtitles shorter
|
|
||||||
* Resizing the terminal so that the lines don't wrap.
|
|
||||||
|
|
||||||
|
|
||||||
#### The text is pushed over too far to the right
|
#### The text is pushed over too far to the right
|
||||||
|
|
||||||
The easiest way to fix this is to change the value of `--gap` or `$gap`<br \>
|
The easiest way to fix this is to change the value of `--gap` or `$gap`<br \>
|
||||||
|
|
|
@ -212,10 +212,6 @@ colors=(distro)
|
||||||
# Text Options {{{
|
# Text Options {{{
|
||||||
|
|
||||||
|
|
||||||
# Toggle line wrapping
|
|
||||||
# --line_wrap on/off
|
|
||||||
line_wrap="off"
|
|
||||||
|
|
||||||
# Toggle bold text
|
# Toggle bold text
|
||||||
# --bold on/off
|
# --bold on/off
|
||||||
bold="on"
|
bold="on"
|
||||||
|
|
42
neofetch
42
neofetch
|
@ -217,10 +217,6 @@ colors=(distro)
|
||||||
# Text Options {{{
|
# Text Options {{{
|
||||||
|
|
||||||
|
|
||||||
# Toggle line wrapping
|
|
||||||
# --line_wrap on/off
|
|
||||||
line_wrap="off"
|
|
||||||
|
|
||||||
# Toggle bold text
|
# Toggle bold text
|
||||||
# --bold on/off
|
# --bold on/off
|
||||||
bold="on"
|
bold="on"
|
||||||
|
@ -2486,6 +2482,14 @@ info () {
|
||||||
# Trim whitespace
|
# Trim whitespace
|
||||||
output="$(trim "$output")"
|
output="$(trim "$output")"
|
||||||
|
|
||||||
|
# Fix rendering issues with w3m and lines that
|
||||||
|
# wrap to the next line by adding a max line
|
||||||
|
# length.
|
||||||
|
if [ "$image" != "off" ] && [ "$image" != "ascii" ] && [ "$1" != "cols" ]; then
|
||||||
|
padding_num="${padding/\\033\[}"
|
||||||
|
output="$(printf "%.$((columns - ${padding_num/C} - gap - ${#subtitle}))s" "$output")"
|
||||||
|
fi
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
title)
|
title)
|
||||||
string="${title_color}${bold}${output}"
|
string="${title_color}${bold}${output}"
|
||||||
|
@ -2516,16 +2520,26 @@ info () {
|
||||||
# Prin {{{
|
# Prin {{{
|
||||||
|
|
||||||
prin () {
|
prin () {
|
||||||
if [ -z "$2" ]; then
|
string="$1${2:+: $2}"
|
||||||
string="${info_color}${1}"
|
|
||||||
length="${#1}"
|
|
||||||
|
|
||||||
else
|
# Fix rendering issues with w3m and lines that
|
||||||
string="${subtitle_color}${bold}${1}\033[0m"
|
# wrap to the next line by adding a max line
|
||||||
string+="${colon_color}: ${info_color}${2}"
|
# length.
|
||||||
length="$((${#subtitle} + ${#2} + 1))"
|
if [ "$image" != "off" ] && [ "$image" != "ascii" ]; then
|
||||||
|
padding_num="${padding/\\033\[}"
|
||||||
|
string="$(printf "%.$((columns - ${padding_num/C} - gap))s" "$string")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If $2 doesn't exist we format $1 as info
|
||||||
|
if [ -z "$2" ]; then
|
||||||
|
subtitle_color="$info_color"
|
||||||
|
bold=
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Format the output
|
||||||
|
string="${string/:/"\033[0m"${colon_color}:${info_color}}"
|
||||||
|
string="${subtitle_color}${bold}${string}"
|
||||||
|
|
||||||
# Trim whitespace
|
# Trim whitespace
|
||||||
string="$(trim "$string")"
|
string="$(trim "$string")"
|
||||||
|
|
||||||
|
@ -2999,7 +3013,6 @@ usage () { cat << EOF
|
||||||
title, @, underline, subtitle, colon, info
|
title, @, underline, subtitle, colon, info
|
||||||
--underline on/off enable/disable the underline.
|
--underline on/off enable/disable the underline.
|
||||||
--underline_char char Character to use when underlining title
|
--underline_char char Character to use when underlining title
|
||||||
--line_wrap on/off Enable/Disable line wrapping
|
|
||||||
--bold on/off Enable/Disable bold text
|
--bold on/off Enable/Disable bold text
|
||||||
|
|
||||||
|
|
||||||
|
@ -3143,7 +3156,6 @@ while [ "$1" ]; do
|
||||||
# Text Formatting
|
# Text Formatting
|
||||||
--underline) underline_enabled="$2" ;;
|
--underline) underline_enabled="$2" ;;
|
||||||
--underline_char) underline_char="$2" ;;
|
--underline_char) underline_char="$2" ;;
|
||||||
--line_wrap) line_wrap="$2" ;;
|
|
||||||
--bold) bold="$2" ;;
|
--bold) bold="$2" ;;
|
||||||
|
|
||||||
# Color Blocks
|
# Color Blocks
|
||||||
|
@ -3342,7 +3354,7 @@ if [ "$image" != "off" ] && [ "$image" != "ascii" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable line wrap
|
# Disable line wrap
|
||||||
[ "$line_wrap" == "off" ] && printf "\033[?7l"
|
printf "\033[?7l"
|
||||||
|
|
||||||
# Move cursor to the top
|
# Move cursor to the top
|
||||||
[ "$image" != "off" ] && printf "\033[0H"
|
[ "$image" != "off" ] && printf "\033[0H"
|
||||||
|
@ -3371,7 +3383,7 @@ esac
|
||||||
[ "$image" != "off" ] && printf "%b%s" "\033[${lines:-0}H"
|
[ "$image" != "off" ] && printf "%b%s" "\033[${lines:-0}H"
|
||||||
|
|
||||||
# Re-enable line wrap
|
# Re-enable line wrap
|
||||||
[ "$line_wrap" == "off" ] && printf "%b%s" "\033[?7h"
|
printf "%b%s" "\033[?7h"
|
||||||
|
|
||||||
# If enabled take a screenshot
|
# If enabled take a screenshot
|
||||||
if [ "$scrot" == "on" ]; then
|
if [ "$scrot" == "on" ]; then
|
||||||
|
|
|
@ -105,9 +105,6 @@ enable/disable the underline.
|
||||||
.B \--underline_char 'char'
|
.B \--underline_char 'char'
|
||||||
Character to use when underlining title
|
Character to use when underlining title
|
||||||
.TP
|
.TP
|
||||||
.B \--line_wrap 'on/off'
|
|
||||||
Enable/Disable line wrapping
|
|
||||||
.TP
|
|
||||||
.B \--bold 'on/off'
|
.B \--bold 'on/off'
|
||||||
Enable/Disable bold text
|
Enable/Disable bold text
|
||||||
.TP
|
.TP
|
||||||
|
|
Loading…
Reference in a new issue