mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 09:08:38 +00:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5234e76007 | ||
|
3889bf8dd4 | ||
|
9175a47a3c | ||
|
15cd3b3e07 | ||
|
ec29e74406 | ||
|
a2769a93ed | ||
|
8e3be5204d | ||
|
b02ed9fff2 | ||
|
29aabc97fa | ||
|
8707a49f04 | ||
|
b981fb50fa | ||
|
e04302ccec | ||
|
92ecdf0012 | ||
|
e2274fddd8 | ||
|
ba9c7bba23 | ||
|
a4ca62cf5a | ||
|
fca688dd12 | ||
|
e6b8f4f64f | ||
|
8554f42345 | ||
|
2a13d62c0c | ||
|
3ad38d7c95 | ||
|
01ef60445e | ||
|
160276ff6d | ||
|
77282c8fea | ||
|
bff6cf3b1a |
39
CHANGELOG.md
39
CHANGELOG.md
@@ -7,9 +7,44 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- [ascii] Fixed a bug causing Windows 7 ASCII art to not display.
|
||||
- [image] Added new option to configure the resolution of `catimg`.
|
||||
**Contributors**
|
||||
|
||||
- [**@mstraube**](https://github.com/mstraube)
|
||||
- [**@iandrewt**](https://github.com/iandrewt")
|
||||
|
||||
**Operating System**
|
||||
|
||||
- Added support for RedCore Linux. [**@mstraube**](https://github.com/mstraube)
|
||||
|
||||
**General**
|
||||
|
||||
- [output] Added `--json` to output the info in `json`.
|
||||
- [cursor] Fixed prompt location issues after Neofetch is run.
|
||||
- [macOS] Fixed neofetch launching XQuartz.
|
||||
- [misc] Removed `uppercase()`.
|
||||
- [misc] Removed all instances of `export`.
|
||||
|
||||
**Ascii**
|
||||
|
||||
- Fixed a bug causing Windows 7 ASCII art to not display.
|
||||
|
||||
**Image**
|
||||
|
||||
- Removed `catimg` support (*It didn’t allow us to specify height so we
|
||||
couldn’t accurately place the cursor*).
|
||||
- Fixed `tycat`, `sixel` and `kitty icat` image sizes.
|
||||
|
||||
**Screenshot**
|
||||
|
||||
- Removed screenshot functionality.
|
||||
- Removed screenshot upload functionality.
|
||||
|
||||
**Info**
|
||||
|
||||
- [font] Fix iTerm2 checking for 2 extra profiles that don't exist. [**@iandrewt**](https://github.com/iandrewt")
|
||||
- [gpu] Fixed ATI/AMD branding issue.
|
||||
- [song] Fixed song detection on macOS.
|
||||
- [song] Fixed song output on systems using `C` locale.
|
||||
|
||||
## [4.0.2] - 2018-05-19
|
||||
|
||||
|
223
neofetch
223
neofetch
@@ -32,6 +32,8 @@ bash_version="${BASH_VERSION/.*}"
|
||||
sys_locale="${LANG:-C}"
|
||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||
PATH="/usr/xpg4/bin:/usr/sbin:/sbin:/usr/etc:/usr/libexec:${PATH}"
|
||||
reset="\e[0m"
|
||||
shopt -s nocasematch
|
||||
|
||||
# Speed up script by not using unicode.
|
||||
LC_ALL=C
|
||||
@@ -40,9 +42,6 @@ LANG=C
|
||||
# Fix issues with gsettings.
|
||||
GIO_EXTRA_MODULES="/usr/lib/x86_64-linux-gnu/gio/modules/"
|
||||
|
||||
shopt -s nocasematch
|
||||
reset="\e[0m"
|
||||
|
||||
# Neofetch default config.
|
||||
read -rd '' config <<'EOF'
|
||||
# See this wiki page for more info:
|
||||
@@ -400,8 +399,6 @@ disk_subtitle="mount"
|
||||
#
|
||||
# Available values for 'player-name':
|
||||
#
|
||||
# Google Play
|
||||
# Spotify
|
||||
# amarok
|
||||
# audacious
|
||||
# banshee
|
||||
@@ -413,8 +410,9 @@ disk_subtitle="mount"
|
||||
# elisa
|
||||
# exaile
|
||||
# gnome-music
|
||||
# Google Play
|
||||
# guayadeque
|
||||
# iTunes$
|
||||
# iTunes
|
||||
# juk
|
||||
# lollypop
|
||||
# mocp
|
||||
@@ -425,12 +423,13 @@ disk_subtitle="mount"
|
||||
# qmmp
|
||||
# quodlibet
|
||||
# rhythmbox
|
||||
# sayonara
|
||||
# spotify
|
||||
# Spotify
|
||||
# tomahawk
|
||||
# vlc
|
||||
# xmms2d
|
||||
# yarock
|
||||
# sayonara
|
||||
# vlc
|
||||
music_player="auto"
|
||||
|
||||
# Format to display song information.
|
||||
@@ -639,7 +638,7 @@ disk_display="off"
|
||||
# Image backend.
|
||||
#
|
||||
# Default: 'ascii'
|
||||
# Values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', 'termpix', 'pixterm', 'tycat', 'w3m'
|
||||
# Values: 'ascii', 'caca', 'jp2a', 'iterm2', 'off', 'termpix', 'pixterm', 'tycat', 'w3m'
|
||||
# Flag: --backend
|
||||
image_backend="ascii"
|
||||
|
||||
@@ -741,14 +740,6 @@ crop_offset="center"
|
||||
# --size
|
||||
image_size="auto"
|
||||
|
||||
# Catimg block size.
|
||||
# Control the resolution of catimg.
|
||||
#
|
||||
# Default: '2'
|
||||
# Values: '1', '2'
|
||||
# Flags: --catimg_size
|
||||
catimg_size="2"
|
||||
|
||||
# Gap between image and text
|
||||
#
|
||||
# Default: '3'
|
||||
@@ -972,8 +963,6 @@ get_distro() {
|
||||
|
||||
"Windows")
|
||||
distro="$(wmic os get Caption)"
|
||||
|
||||
# Strip crap from the output of wmic.
|
||||
distro="${distro/Caption}"
|
||||
distro="${distro/Microsoft }"
|
||||
;;
|
||||
@@ -1007,15 +996,8 @@ get_distro() {
|
||||
|
||||
[[ -z "$distro" ]] && distro="$os (Unknown)"
|
||||
|
||||
# Get OS architecture.
|
||||
case "$os" in
|
||||
"Solaris" | "AIX" | "Haiku" | "IRIX" | "FreeMiNT") machine_arch="$(uname -p)" ;;
|
||||
*) machine_arch="$(uname -m)" ;;
|
||||
|
||||
esac
|
||||
if [[ "$os_arch" == "on" ]]; then
|
||||
distro+=" ${machine_arch}"
|
||||
fi
|
||||
[[ "$os_arch" == "on" ]] && \
|
||||
distro+=" $HOSTTYPE"
|
||||
|
||||
[[ "${ascii_distro:-auto}" == "auto" ]] && \
|
||||
ascii_distro="$(trim "$distro")"
|
||||
@@ -1049,7 +1031,7 @@ get_model() {
|
||||
;;
|
||||
|
||||
"iPhone OS")
|
||||
case "$machine_arch" in
|
||||
case "$HOSTTYPE" in
|
||||
"iPad1,1") model="iPad" ;;
|
||||
"iPad2,"[1-4]) model="iPad 2" ;;
|
||||
"iPad3,"[1-3]) model="iPad 3" ;;
|
||||
@@ -1250,7 +1232,7 @@ get_uptime() {
|
||||
get_packages() {
|
||||
case "$os" in
|
||||
"Linux" | "BSD" | "iPhone OS" | "Solaris")
|
||||
type -p paclog-pkglist >/dev/null && \
|
||||
type -p pacman-key >/dev/null && \
|
||||
packages="$(pacman -Qq --color never | wc -l)"
|
||||
|
||||
type -p dpkg >/dev/null && \
|
||||
@@ -1265,7 +1247,7 @@ get_packages() {
|
||||
type -p xbps-query >/dev/null && \
|
||||
((packages+=$(xbps-query -l | wc -l)))
|
||||
|
||||
type -p pkginfo >/dev/null && \
|
||||
[[ "$os" != "Linux" ]] && type -p pkginfo >/dev/null && \
|
||||
((packages+=$(pkginfo -i | wc -l)))
|
||||
|
||||
type -p emerge >/dev/null && \
|
||||
@@ -1750,7 +1732,7 @@ get_cpu() {
|
||||
# Get CPU name.
|
||||
cpu_file="/proc/cpuinfo"
|
||||
|
||||
case "$machine_arch" in
|
||||
case "$HOSTTYPE" in
|
||||
"frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*)
|
||||
cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")"
|
||||
;;
|
||||
@@ -1804,7 +1786,7 @@ get_cpu() {
|
||||
# Get CPU cores.
|
||||
case "$cpu_cores" in
|
||||
"logical" | "on") cores="$(grep -c "^processor" "$cpu_file")" ;;
|
||||
"physical") cores="$(grep "^core id" "$cpu_file" | sort -u | wc -l)" ;;
|
||||
"physical") cores="$(awk '/^core id/&&!a[$0]++{++i}END{print i}' "$cpu_file")" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
@@ -1819,7 +1801,7 @@ get_cpu() {
|
||||
;;
|
||||
|
||||
"iPhone OS")
|
||||
case "$machine_arch" in
|
||||
case "$HOSTTYPE" in
|
||||
"iPhone1,"[1-2] | "iPod1,1") cpu="Samsung S5L8900 (1) @ 412MHz" ;;
|
||||
"iPhone2,1") cpu="Samsung S5PC100 (1) @ 600MHz" ;;
|
||||
"iPhone3,"[1-3] | "iPod4,1") cpu="Apple A4 (1) @ 800MHz" ;;
|
||||
@@ -2089,9 +2071,6 @@ get_gpu() {
|
||||
;;
|
||||
|
||||
*"intel"*)
|
||||
type -p glxinfo >/dev/null && \
|
||||
gpu="$(glxinfo | grep "Device:.*Intel")"
|
||||
|
||||
gpu="${gpu/*Intel/Intel}"
|
||||
gpu="${gpu/'(R)'}"
|
||||
gpu="${gpu/'Corporation'}"
|
||||
@@ -2133,7 +2112,7 @@ get_gpu() {
|
||||
;;
|
||||
|
||||
"iPhone OS")
|
||||
case "$machine_arch" in
|
||||
case "$HOSTTYPE" in
|
||||
"iPhone1,"[1-2]) gpu="PowerVR MBX Lite 3D" ;;
|
||||
"iPhone5,"[1-4]) gpu="PowerVR SGX543MP3" ;;
|
||||
"iPhone8,"[1-4]) gpu="PowerVR GT7600" ;;
|
||||
@@ -2317,40 +2296,42 @@ get_memory() {
|
||||
}
|
||||
|
||||
get_song() {
|
||||
player="$(ps -e | grep -m 1 -F \
|
||||
-e "Google Play" \
|
||||
-e "Spotify" \
|
||||
-e "amarok" \
|
||||
-e "audacious" \
|
||||
-e "banshee" \
|
||||
-e "bluemindo" \
|
||||
-e "clementine" \
|
||||
-e "cmus" \
|
||||
-e "deadbeef" \
|
||||
-e "deepin-music" \
|
||||
-e "elisa" \
|
||||
-e "exaile" \
|
||||
-e "gnome-music" \
|
||||
-e "guayadeque" \
|
||||
-e "iTunes" \
|
||||
-e "juk" \
|
||||
-e "lollypop" \
|
||||
-e "mocp" \
|
||||
-e "mopidy" \
|
||||
-e "mpd" \
|
||||
-e "pogo" \
|
||||
-e "pragha" \
|
||||
-e "qmmp" \
|
||||
-e "quodlibet" \
|
||||
-e "rhythmbox" \
|
||||
-e "spotify" \
|
||||
-e "tomahawk" \
|
||||
-e "xmms2d" \
|
||||
-e "yarock" \
|
||||
-e "sayonara" \
|
||||
-e "vlc")"
|
||||
player="${player/* }"
|
||||
player="${player##*/}"
|
||||
players=(
|
||||
"amarok"
|
||||
"audacious"
|
||||
"banshee"
|
||||
"bluemindo"
|
||||
"clementine"
|
||||
"cmus"
|
||||
"deadbeef"
|
||||
"deepin-music"
|
||||
"elise"
|
||||
"exaile"
|
||||
"gnome-music"
|
||||
"Google Play"
|
||||
"guayadeque"
|
||||
"iTunes"
|
||||
"juk"
|
||||
"lollypop"
|
||||
"mocp"
|
||||
"mopidy"
|
||||
"mpd"
|
||||
"pogo"
|
||||
"pragha"
|
||||
"qmmp"
|
||||
"quodlibet"
|
||||
"rhythmbox"
|
||||
"sayonara"
|
||||
"spotify"
|
||||
"Spotify"
|
||||
"tomahawk"
|
||||
"vlc"
|
||||
"xmms2d"
|
||||
"yarock"
|
||||
)
|
||||
|
||||
printf -v players "|%s" "${players[@]}"
|
||||
player="$(ps -e | awk -v pattern="(${players:1})$" '$0 ~ pattern {print $NF; exit}')"
|
||||
|
||||
[[ "$music_player" && "$music_player" != "auto" ]] && \
|
||||
player="$music_player"
|
||||
@@ -2363,18 +2344,18 @@ get_song() {
|
||||
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \
|
||||
string:'Metadata' |\
|
||||
awk -F '"' 'BEGIN {RS=" entry"}; /xesam:artist/ {a = $4} /xesam:album/ {b = $4}
|
||||
/xesam:title/ {t = $4} END {print a " ‡ " b " ‡ " t}'
|
||||
/xesam:title/ {t = $4} END {print a " \n " b " \n " t}'
|
||||
)"
|
||||
}
|
||||
|
||||
case "${player/*\/}" in
|
||||
"mpd"* | "mopidy"*) song="$(mpc -f '%artist% ‡ %album% ‡ %title%' current)" ;;
|
||||
"mocp"*) song="$(mocp -Q "%artist ‡ %album ‡ %song")" ;;
|
||||
"mpd"* | "mopidy"*) song="$(mpc -f '%artist% \n %album% \n %title%' current)" ;;
|
||||
"mocp"*) song="$(mocp -Q "%artist \n %album \n %song")" ;;
|
||||
"google play"*) song="$(gpmdp-remote current)" ;;
|
||||
"rhythmbox"*) song="$(rhythmbox-client --print-playing-format '%ta ‡ %at ‡ %tt')" ;;
|
||||
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% ‡ %album% ‡ %title%')" ;;
|
||||
"xmms2d"*) song="$(xmms2 current -f '${artist} ‡ ${album} ‡ ${title}')" ;;
|
||||
"qmmp"*) song="$(qmmp --nowplaying '%p ‡ %a ‡ %t')" ;;
|
||||
"rhythmbox"*) song="$(rhythmbox-client --print-playing-format '%ta \n %at \n %tt')" ;;
|
||||
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% \n %album% \n %title%')" ;;
|
||||
"xmms2d"*) song="$(xmms2 current -f '${artist} \n ${album} \n ${title}')" ;;
|
||||
"qmmp"*) song="$(qmmp --nowplaying '%p \n %a \n %t')" ;;
|
||||
"gnome-music"*) get_song_dbus "GnomeMusic" ;;
|
||||
"lollypop"*) get_song_dbus "Lollypop" ;;
|
||||
"clementine"*) get_song_dbus "clementine" ;;
|
||||
@@ -2394,7 +2375,7 @@ get_song() {
|
||||
/tag artist/ {$1=$2=""; sub(" ", ""); a=$0}\
|
||||
/tag album / {$1=$2=""; sub(" ", ""); b=$0}\
|
||||
/tag title/ {$1=$2=""; sub(" ", ""); t=$0}\
|
||||
END { print a " ‡ " b " ‡ " t }')"
|
||||
END { print a " \n " b " \n " t }')"
|
||||
;;
|
||||
|
||||
"spotify"*)
|
||||
@@ -2403,61 +2384,61 @@ get_song() {
|
||||
|
||||
"Mac OS X")
|
||||
song="$(osascript -e 'tell application "Spotify" to artist of current track as¬
|
||||
string & " ‡ " & album of current track as¬
|
||||
string & " ‡ " & name of current track as string')"
|
||||
string & " \n " & album of current track as¬
|
||||
string & " \n " & name of current track as string')"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"itunes"*)
|
||||
song="$(osascript -e 'tell application "iTunes" to artist of current track as¬
|
||||
string & " ‡ " & album of current track as¬
|
||||
string & " ‡ " & name of current track as string')"
|
||||
string & " \n " & album of current track as¬
|
||||
string & " \n " & name of current track as string')"
|
||||
;;
|
||||
|
||||
"banshee"*)
|
||||
song="$(banshee --query-artist --query-album --query-title |\
|
||||
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
|
||||
END{print a " ‡ " b " ‡ "t}')"
|
||||
END{print a " \n " b " \n "t}')"
|
||||
;;
|
||||
|
||||
"amarok"*)
|
||||
song="$(qdbus org.kde.amarok /Player GetMetadata |\
|
||||
awk -F':' '/^artist:/ {a=$2} /^album:/ {b=$2} /^title:/ {t=$2}
|
||||
END{print a " ‡ " b " ‡ " t}')"
|
||||
END{print a " \n " b " \n " t}')"
|
||||
;;
|
||||
|
||||
"pragha"*)
|
||||
song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
|
||||
END{print a " ‡ " b " ‡ " t}')"
|
||||
END{print a " \n " b " \n " t}')"
|
||||
;;
|
||||
|
||||
"exaile"*)
|
||||
song="$(dbus-send --print-reply --dest=org.exaile.Exaile /org/exaile/Exaile \
|
||||
org.exaile.Exaile.Query |
|
||||
awk -F':|,' '{if ($6 && $8 && $4) printf $6 " ‡" $8 " ‡" $4}')"
|
||||
awk -F':|,' '{if ($6 && $8 && $4) printf $6 " \n" $8 " \n" $4}')"
|
||||
;;
|
||||
|
||||
"quodlibet"*)
|
||||
song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet \
|
||||
/net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\
|
||||
awk -F'"' '/artist/ {getline; a=$2} /album/ {getline; b=$2}
|
||||
/title/ {getline; t=$2} END{print a " ‡ " b " ‡ " t}')"
|
||||
/title/ {getline; t=$2} END{print a " \n " b " \n " t}')"
|
||||
;;
|
||||
|
||||
"pogo"*)
|
||||
song="$(dbus-send --print-reply --dest=org.mpris.pogo /Player \
|
||||
org.freedesktop.MediaPlayer.GetMetadata |
|
||||
awk -F'"' '/string "artist"/ {getline; a=$2} /string "album"/ {getline; b=$2} \
|
||||
/string "title"/ {getline; t=$2} END{print a " ‡ " b " ‡ " t}')"
|
||||
/string "title"/ {getline; t=$2} END{print a " \n " b " \n " t}')"
|
||||
;;
|
||||
|
||||
*) mpc >/dev/null 2>&1 && song="$(mpc -f '%artist% ‡ %album% ‡ %title%' current)" ;;
|
||||
*) mpc >/dev/null 2>&1 && song="$(mpc -f '%artist% \n %album% \n %title%' current)" ;;
|
||||
esac
|
||||
|
||||
[[ "$song" != *[a-z]* ]] && { unset -v song; return; }
|
||||
|
||||
LC_ALL="$sys_locale" IFS="‡" read -r artist album title <<< "$song"
|
||||
IFS=$'\n' read -d "" -r artist album title <<< "$song"
|
||||
|
||||
# Display Artist, Album and Title on separate lines.
|
||||
if [[ "$song_shorthand" == "on" ]]; then
|
||||
@@ -3389,7 +3370,7 @@ image_backend() {
|
||||
"ascii") get_ascii ;;
|
||||
"off") image_backend="off" ;;
|
||||
|
||||
"caca" | "catimg" | "jp2a" | "iterm2" | "termpix" |\
|
||||
"caca" | "jp2a" | "iterm2" | "termpix" |\
|
||||
"tycat" | "w3m" | "sixel" | "pixterm" | "kitty")
|
||||
get_image_source
|
||||
|
||||
@@ -3418,7 +3399,7 @@ image_backend() {
|
||||
|
||||
*)
|
||||
err "Image: Unknown image backend specified '$image_backend'."
|
||||
err "Image: Valid backends are: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'kitty',
|
||||
err "Image: Valid backends are: 'ascii', 'caca', 'jp2a', 'iterm2', 'kitty',
|
||||
'off', 'sixel', 'pixterm', 'termpix', 'tycat', 'w3m')"
|
||||
err "Image: Falling back to ascii mode."
|
||||
get_ascii
|
||||
@@ -3645,6 +3626,9 @@ get_term_size() {
|
||||
term_width="${term_size[2]/t*}"
|
||||
fi
|
||||
|
||||
[[ "$image_backend" == "kitty" ]] && \
|
||||
IFS=x read -r term_width term_height < <(kitty icat --print-window-size)
|
||||
|
||||
# Get terminal width/height if \e[14t is unsupported.
|
||||
if (( "${term_width:-0}" < 50 )) && [[ "$DISPLAY" && "$os" != "Mac OS X" ]]; then
|
||||
if type -p xdotool >/dev/null 2>&1; then
|
||||
@@ -3800,18 +3784,19 @@ display_image() {
|
||||
to_off "Image: libcaca failed to display the image."
|
||||
;;
|
||||
|
||||
"catimg")
|
||||
catimg -w "$((width * 2 / font_width))" -r "$catimg_size" "$image" ||\
|
||||
to_off "Image: catimg failed to display the image."
|
||||
;;
|
||||
|
||||
"jp2a")
|
||||
jp2a --width="$((width / font_width))" --colors "$image" ||\
|
||||
jp2a --width="$((width / font_width))" \
|
||||
--height="$((height / font_height))" \
|
||||
--colors "$image" ||\
|
||||
to_off "Image: jp2a failed to display the image."
|
||||
;;
|
||||
|
||||
"kitty")
|
||||
kitty icat --align left --place "${width}x${height}@${xoffset}x${yoffset}" "$image" ||\
|
||||
kitty icat \
|
||||
--align left \
|
||||
--place "$((width / font_width))x$((height / font_height))\
|
||||
@${xoffset}x${yoffset}" \
|
||||
"$image" ||\
|
||||
to_off "Image: kitty failed to display the image."
|
||||
;;
|
||||
|
||||
@@ -3823,12 +3808,16 @@ display_image() {
|
||||
;;
|
||||
|
||||
"sixel")
|
||||
img2sixel -w "$width" "$image" ||\
|
||||
img2sixel -w "$width" \
|
||||
-h "$height" \
|
||||
"$image" ||\
|
||||
to_off "Image: libsixel failed to display the image."
|
||||
;;
|
||||
|
||||
"termpix")
|
||||
termpix --width "$((width / font_width))" "$image" ||\
|
||||
termpix --width "$((width / font_width))" \
|
||||
--height "$((height / font_height))" \
|
||||
"$image" ||\
|
||||
to_off "Image: termpix failed to display the image."
|
||||
;;
|
||||
|
||||
@@ -3843,7 +3832,7 @@ display_image() {
|
||||
;;
|
||||
|
||||
"tycat")
|
||||
tycat "$image" ||\
|
||||
tycat -g "${width}x${height}" "$image" ||\
|
||||
to_off "Image: tycat failed to display the image."
|
||||
;;
|
||||
|
||||
@@ -4201,7 +4190,7 @@ kde_config_dir() {
|
||||
|
||||
dynamic_prompt() {
|
||||
[[ "$image_backend" == "off" ]] && { printf "\n"; return; }
|
||||
[[ "$image_backend" != "ascii" ]] && ((lines+=1000))
|
||||
[[ "$image_backend" != "ascii" ]] && lines="$(((height + yoffset) / font_height + 1))"
|
||||
|
||||
# If the ascii art is taller than the info.
|
||||
if ((lines > info_height)); then
|
||||
@@ -4210,13 +4199,8 @@ dynamic_prompt() {
|
||||
lines=1
|
||||
fi
|
||||
|
||||
# Set the prompt location.
|
||||
if ((lines >= 1)); then
|
||||
case "$kernel_name" in
|
||||
"OpenBSD") tput cud "$lines" ;;
|
||||
*) printf "%b" "\e[${lines}B" ;;
|
||||
esac
|
||||
fi
|
||||
printf -v nlines "%${lines}s"
|
||||
printf "%b" "${nlines// /\\n}"
|
||||
}
|
||||
|
||||
cache_uname() {
|
||||
@@ -4355,7 +4339,9 @@ Options:
|
||||
|
||||
INFO:
|
||||
--disable infoname Allows you to disable an info line from appearing
|
||||
in the output.
|
||||
in the output. 'infoname' is the function name from the
|
||||
'print_info()' function inside the config file.
|
||||
For example: 'info \"Memory\" memory' would be '--disable memory'
|
||||
|
||||
NOTE: You can supply multiple args. eg. 'neofetch --disable cpu gpu'
|
||||
|
||||
@@ -4460,14 +4446,13 @@ BARS:
|
||||
|
||||
IMAGE BACKEND:
|
||||
--backend backend Which image backend to use.
|
||||
Possible values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off',
|
||||
Possible values: 'ascii', 'caca', 'jp2a', 'iterm2', 'off',
|
||||
'sixel', 'tycat', 'w3m'
|
||||
--source source Which image or ascii file to use.
|
||||
Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img',
|
||||
'/path/to/ascii', '/path/to/dir/'
|
||||
--ascii source Shortcut to use 'ascii' backend.
|
||||
--caca source Shortcut to use 'caca' backend.
|
||||
--catimg source Shortcut to use 'catimg' backend.
|
||||
--iterm2 source Shortcut to use 'iterm2' backend.
|
||||
--jp2a source Shortcut to use 'jp2a' backend.
|
||||
--kitty source Shortcut to use 'kitty' backend.
|
||||
@@ -4476,7 +4461,7 @@ IMAGE BACKEND:
|
||||
--termpix source Shortcut to use 'termpix' backend.
|
||||
--tycat source Shortcut to use 'tycat' backend.
|
||||
--w3m source Shortcut to use 'w3m' backend.
|
||||
--off Shortcut to use 'off' backend.
|
||||
--off Shortcut to use 'off' backend (Disable ascii art).
|
||||
|
||||
NOTE: 'source; can be any of the following: 'auto', 'ascii', 'wallpaper', '/path/to/img',
|
||||
'/path/to/ascii', '/path/to/dir/'
|
||||
@@ -4509,7 +4494,6 @@ IMAGE:
|
||||
in some terminals emulators when using image mode.
|
||||
--size 00px | --size 00% How to size the image.
|
||||
Possible values: auto, 00px, 00%, none
|
||||
--catimg_size 1/2 Change the resolution of catimg.
|
||||
--crop_mode mode Which crop mode to use
|
||||
Takes the values: normal, fit, fill
|
||||
--crop_offset value Change the crop offset for normal mode.
|
||||
@@ -4653,7 +4637,7 @@ get_args() {
|
||||
# Image backend
|
||||
"--backend") image_backend="$2" ;;
|
||||
"--source") image_source="$2" ;;
|
||||
"--ascii" | "--caca" | "--catimg" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
|
||||
"--ascii" | "--caca" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
|
||||
"--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
|
||||
image_backend="${1/--}"
|
||||
case "$2" in
|
||||
@@ -4665,7 +4649,6 @@ get_args() {
|
||||
# Image options
|
||||
"--loop") image_loop="on" ;;
|
||||
"--image_size" | "--size") image_size="$2" ;;
|
||||
"--catimg_size") catimg_size="$2" ;;
|
||||
"--crop_mode") crop_mode="$2" ;;
|
||||
"--crop_offset") crop_offset="$2" ;;
|
||||
"--xoffset") xoffset="$2" ;;
|
||||
@@ -8451,10 +8434,8 @@ main() {
|
||||
err "Neofetch command: $0 $*"
|
||||
err "Neofetch version: $version"
|
||||
|
||||
# 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 1; done
|
||||
|
||||
return 0
|
||||
|
14
neofetch.1
14
neofetch.1
@@ -16,7 +16,9 @@ NOTE: Every launch flag has a config option.
|
||||
.TP
|
||||
\fB\-\-disable\fR infoname
|
||||
Allows you to disable an info line from appearing
|
||||
in the output.
|
||||
in the output. 'infoname' is the function name from the
|
||||
\&'print_info()' function inside the config file.
|
||||
For example: 'info "Memory" memory' would be '\-\-disable memory'
|
||||
.IP
|
||||
NOTE: You can supply multiple args. eg. 'neofetch \fB\-\-disable\fR cpu gpu'
|
||||
.TP
|
||||
@@ -191,7 +193,7 @@ Possible values: bar, infobar, barinfo, off
|
||||
.TP
|
||||
\fB\-\-backend\fR backend
|
||||
Which image backend to use.
|
||||
Possible values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off',
|
||||
Possible values: 'ascii', 'caca', 'jp2a', 'iterm2', 'off',
|
||||
\&'sixel', 'tycat', 'w3m'
|
||||
.TP
|
||||
\fB\-\-source\fR source
|
||||
@@ -205,9 +207,6 @@ Shortcut to use 'ascii' backend.
|
||||
\fB\-\-caca\fR source
|
||||
Shortcut to use 'caca' backend.
|
||||
.TP
|
||||
\fB\-\-catimg\fR source
|
||||
Shortcut to use 'catimg' backend.
|
||||
.TP
|
||||
\fB\-\-iterm2\fR source
|
||||
Shortcut to use 'iterm2' backend.
|
||||
.TP
|
||||
@@ -233,7 +232,7 @@ Shortcut to use 'tycat' backend.
|
||||
Shortcut to use 'w3m' backend.
|
||||
.TP
|
||||
\fB\-\-off\fR
|
||||
Shortcut to use 'off' backend.
|
||||
Shortcut to use 'off' backend (Disable ascii art).
|
||||
.IP
|
||||
NOTE: 'source; can be any of the following: 'auto', 'ascii', 'wallpaper', '/path/to/img',
|
||||
\&'/path/to/ascii', '/path/to/dir/'
|
||||
@@ -276,9 +275,6 @@ in some terminals emulators when using image mode.
|
||||
How to size the image.
|
||||
Possible values: auto, 00px, 00%, none
|
||||
.TP
|
||||
\fB\-\-catimg_size\fR 1/2
|
||||
Change the resolution of catimg.
|
||||
.TP
|
||||
\fB\-\-crop_mode\fR mode
|
||||
Which crop mode to use
|
||||
Takes the values: normal, fit, fill
|
||||
|
Reference in New Issue
Block a user