From 6f8dc8ad64bf0c70d145b90d08df36ffd3abe90e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 13 Jun 2016 17:25:10 +1000 Subject: [PATCH 1/3] Remove prompr_height --- config/config | 6 ----- neofetch | 70 +++++++++++++++++++++++---------------------------- 2 files changed, 31 insertions(+), 45 deletions(-) diff --git a/config/config b/config/config index d673ae5f..19dd34bb 100644 --- a/config/config +++ b/config/config @@ -223,12 +223,6 @@ underline_enabled="on" # --underline_char char underline_char="-" -# Prompt height -# You should only have to change this if your -# prompt is greater than 2 lines high. -# --prompt_height num -prompt_height=1 - # }}} diff --git a/neofetch b/neofetch index bb73bc29..2342a3a5 100755 --- a/neofetch +++ b/neofetch @@ -42,38 +42,38 @@ export LANG=C # See this wiki page for more info: # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info printinfo () { - info title - info underline + # info title + # info underline - info "OS" distro - info "Kernel" kernel - info "Uptime" uptime - info "Packages" packages - info "Shell" shell - info "Resolution" resolution - info "DE" de - info "WM" wm - info "WM Theme" wmtheme - info "Theme" theme - info "Icons" icons - info "Terminal" term - info "Terminal Font" termfont - info "CPU" cpu - info "GPU" gpu - info "Memory" memory + # info "OS" distro + # info "Kernel" kernel + # info "Uptime" uptime + # info "Packages" packages + # info "Shell" shell + # info "Resolution" resolution + # info "DE" de + # info "WM" wm + # info "WM Theme" wmtheme + # info "Theme" theme + # info "Icons" icons + # info "Terminal" term + # info "Terminal Font" termfont + # info "CPU" cpu + # info "GPU" gpu + # info "Memory" memory - # info "Disk" disk - # info "Battery" battery - # info "Font" font - # info "Song" song - # info "Local IP" localip - # info "Public IP" publicip - # info "Users" users - # info "Birthday" birthday + # # info "Disk" disk + # # info "Battery" battery + # # info "Font" font + # # info "Song" song + # # info "Local IP" localip + # # info "Public IP" publicip + # # info "Users" users + # # info "Birthday" birthday - info linebreak - info cols - info linebreak + # info linebreak + # info cols + # info linebreak info linebreak } @@ -248,12 +248,6 @@ underline_enabled="on" # --underline_char char underline_char="-" -# Prompt height -# You should only have to change this if your -# prompt is greater than 2 lines high. -# --prompt_height num -prompt_height=1 - # }}} @@ -2991,8 +2985,6 @@ usage () { cat << EOF --underline_char char Character to use when underlining title --line_wrap on/off Enable/Disable line wrapping --bold on/off Enable/Disable bold text - --prompt_height num Set this to your prompt height to fix issues with - the text going off screen at the top Color Blocks: @@ -3139,7 +3131,6 @@ while [ "$1" ]; do --underline_char) underline_char="$2" ;; --line_wrap) line_wrap="$2" ;; --bold) bold="$2" ;; - --prompt_height) prompt_height="$2" ;; # Color Blocks --color_blocks) color_blocks="$2" ;; @@ -3352,11 +3343,12 @@ printinfo if [ "$image" != "off" ]; then # Get cursor position info_height="$(stty -echo; IFS=';' read -rdR -t 1 -d c -p $'\033[6n\033[c' ROW COL; printf "%s" "${ROW#*[}"; stty echo)" + lines="$((${width:-1} / ${font_width:-1} / 2 + 3))" # Set cursor position dynamically based on height of ascii/text. [ "${lines:-0}" -lt "${info_height:-0}" ] && lines="$info_height" - printf "%b%s" "\033[${lines}H\033[${prompt_height}A" + printf "%b%s" "\033[${lines}H" fi # Re-enable line wrap From 64ed65fbf07b38ec779362aefda36663e652be84 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 13 Jun 2016 17:28:01 +1000 Subject: [PATCH 2/3] Uncomment functions --- neofetch | 58 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/neofetch b/neofetch index 2342a3a5..c6a6f2b3 100755 --- a/neofetch +++ b/neofetch @@ -42,38 +42,38 @@ export LANG=C # See this wiki page for more info: # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info printinfo () { - # info title - # info underline + info title + info underline - # info "OS" distro - # info "Kernel" kernel - # info "Uptime" uptime - # info "Packages" packages - # info "Shell" shell - # info "Resolution" resolution - # info "DE" de - # info "WM" wm - # info "WM Theme" wmtheme - # info "Theme" theme - # info "Icons" icons - # info "Terminal" term - # info "Terminal Font" termfont - # info "CPU" cpu - # info "GPU" gpu - # info "Memory" memory + info "OS" distro + info "Kernel" kernel + info "Uptime" uptime + info "Packages" packages + info "Shell" shell + info "Resolution" resolution + info "DE" de + info "WM" wm + info "WM Theme" wmtheme + info "Theme" theme + info "Icons" icons + info "Terminal" term + info "Terminal Font" termfont + info "CPU" cpu + info "GPU" gpu + info "Memory" memory - # # info "Disk" disk - # # info "Battery" battery - # # info "Font" font - # # info "Song" song - # # info "Local IP" localip - # # info "Public IP" publicip - # # info "Users" users - # # info "Birthday" birthday + # info "Disk" disk + # info "Battery" battery + # info "Font" font + # info "Song" song + # info "Local IP" localip + # info "Public IP" publicip + # info "Users" users + # info "Birthday" birthday - # info linebreak - # info cols - # info linebreak + info linebreak + info cols + info linebreak info linebreak } From 43d4e1e865f2376d3342be566dd1c5a18c247283 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 13 Jun 2016 17:29:25 +1000 Subject: [PATCH 3/3] Add comment --- neofetch | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neofetch b/neofetch index c6a6f2b3..2e4e71c8 100755 --- a/neofetch +++ b/neofetch @@ -3343,6 +3343,8 @@ printinfo if [ "$image" != "off" ]; then # Get cursor position info_height="$(stty -echo; IFS=';' read -rdR -t 1 -d c -p $'\033[6n\033[c' ROW COL; printf "%s" "${ROW#*[}"; stty echo)" + + # Calculate image height in terminal cells. lines="$((${width:-1} / ${font_width:-1} / 2 + 3))" # Set cursor position dynamically based on height of ascii/text.