Merge branch 'master' of github.com:dylanaraps/neofetch into master

This commit is contained in:
Dylan Araps 2020-10-04 13:42:18 +03:00
commit d6cd1c135a
1 changed files with 87 additions and 16 deletions

103
neofetch
View File

@ -508,6 +508,7 @@ disk_percent="on"
# iTunes # iTunes
# juk # juk
# lollypop # lollypop
# MellowPlayer
# mocp # mocp
# mopidy # mopidy
# mpd # mpd
@ -743,7 +744,7 @@ disk_display="off"
# Image backend. # Image backend.
# #
# Default: 'ascii' # Default: 'ascii'
# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', # Values: 'ascii', 'caca', 'catimg', 'chafa', 'jp2a', 'iterm2', 'off',
# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend # Flag: --backend
image_backend="ascii" image_backend="ascii"
@ -880,6 +881,14 @@ crop_offset="center"
# --size # --size
image_size="auto" 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 # Gap between image and text
# #
# Default: '3' # Default: '3'
@ -1432,7 +1441,7 @@ get_uptime() {
d="$((s / 60 / 60 / 24)) days" d="$((s / 60 / 60 / 24)) days"
h="$((s / 60 / 60 % 24)) hours" h="$((s / 60 / 60 % 24)) hours"
m="$((s / 60 % 60)) mins" m="$((s / 60 % 60)) minutes"
# Remove plural if < 2. # Remove plural if < 2.
((${d/ *} == 1)) && d=${d/s} ((${d/ *} == 1)) && d=${d/s}
@ -1446,20 +1455,24 @@ get_uptime() {
uptime=${d:+$d, }${h:+$h, }$m uptime=${d:+$d, }${h:+$h, }$m
uptime=${uptime%', '} uptime=${uptime%', '}
uptime=${uptime:-$s secs} uptime=${uptime:-$s seconds}
# Make the output of uptime smaller. # Make the output of uptime smaller.
case $uptime_shorthand in case $uptime_shorthand in
on) ;; on)
uptime=${uptime/ minutes/ mins}
uptime=${uptime/ minute/ min}
uptime=${uptime/ seconds/ secs}
;;
tiny) tiny)
uptime=${uptime/ days/d} uptime=${uptime/ days/d}
uptime=${uptime/ day/d} uptime=${uptime/ day/d}
uptime=${uptime/ hours/h} uptime=${uptime/ hours/h}
uptime=${uptime/ hour/h} uptime=${uptime/ hour/h}
uptime=${uptime/ mins/m} uptime=${uptime/ minutes/m}
uptime=${uptime/ min/m} uptime=${uptime/ minute/m}
uptime=${uptime/ secs/s} uptime=${uptime/ seconds/s}
uptime=${uptime//,} uptime=${uptime//,}
;; ;;
esac esac
@ -2113,7 +2126,7 @@ get_cpu() {
# Select the right temperature file. # Select the right temperature file.
for temp_dir in /sys/class/hwmon/*; do for temp_dir in /sys/class/hwmon/*; do
[[ "$(< "${temp_dir}/name")" =~ (coretemp|fam15h_power|k10temp) ]] && { [[ "$(< "${temp_dir}/name")" =~ (cpu_thermal|coretemp|fam15h_power|k10temp) ]] && {
temp_dirs=("$temp_dir"/temp*_input) temp_dirs=("$temp_dir"/temp*_input)
temp_dir=${temp_dirs[0]} temp_dir=${temp_dirs[0]}
break break
@ -2711,6 +2724,7 @@ get_song() {
"iTunes" "iTunes"
"juk" "juk"
"lollypop" "lollypop"
"MellowPlayer"
"mocp" "mocp"
"mopidy" "mopidy"
"mpd" "mpd"
@ -2787,6 +2801,7 @@ get_song() {
"netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;; "netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;;
"plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;; "plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;;
"io.elementary.music"*) get_song_dbus "Music" ;; "io.elementary.music"*) get_song_dbus "Music" ;;
"MellowPlayer"*) get_song_dbus "MellowPlayer3" ;;
"mpd"* | "mopidy"*) "mpd"* | "mopidy"*)
song="$(mpc -f '%artist% \n%album% \n%title%' current "${mpc_args[@]}")" song="$(mpc -f '%artist% \n%album% \n%title%' current "${mpc_args[@]}")"
@ -3841,7 +3856,7 @@ image_backend() {
"ascii") print_ascii ;; "ascii") print_ascii ;;
"off") image_backend="off" ;; "off") image_backend="off" ;;
"caca" | "chafa" | "jp2a" | "iterm2" | "termpix" |\ "caca" | "catimg" | "chafa" | "jp2a" | "iterm2" | "termpix" |\
"tycat" | "w3m" | "sixel" | "pixterm" | "kitty" | "pot") "tycat" | "w3m" | "sixel" | "pixterm" | "kitty" | "pot")
get_image_source get_image_source
@ -3866,9 +3881,9 @@ image_backend() {
*) *)
err "Image: Unknown image backend specified '$image_backend'." err "Image: Unknown image backend specified '$image_backend'."
err "Image: Valid backends are: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'kitty', err "Image: Valid backends are: 'ascii', 'caca', 'catimg', 'chafa', 'jp2a', 'iterm2',
'off', 'sixel', 'pot', 'pixterm', 'termpix', 'tycat', 'kitty', 'off', 'sixel', 'pot', 'pixterm', 'termpix',
'w3m')" 'tycat', 'w3m')"
err "Image: Falling back to ascii mode." err "Image: Falling back to ascii mode."
print_ascii print_ascii
;; ;;
@ -4256,6 +4271,10 @@ display_image() {
"$image" "$image"
;; ;;
"catimg")
catimg -w "$((width*catimg_size / font_width))" -r "$catimg_size" "$image"
;;
"chafa") "chafa")
chafa --stretch --size="$((width / font_width))x$((height / font_height))" "$image" chafa --stretch --size="$((width / font_width))x$((height / font_height))" "$image"
;; ;;
@ -4893,8 +4912,8 @@ BARS:
IMAGE BACKEND: IMAGE BACKEND:
--backend backend Which image backend to use. --backend backend Which image backend to use.
Possible values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', Possible values: 'ascii', 'caca', 'catimg', 'chafa', 'jp2a',
'off', 'sixel', 'tycat', 'w3m', 'kitty' 'iterm2', 'off', 'sixel', 'tycat', 'w3m', 'kitty'
--source source Which image or ascii file to use. --source source Which image or ascii file to use.
Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img', Possible values: 'auto', 'ascii', 'wallpaper', '/path/to/img',
'/path/to/ascii', '/path/to/dir/', 'command output' [ascii] '/path/to/ascii', '/path/to/dir/', 'command output' [ascii]
@ -4904,6 +4923,7 @@ IMAGE BACKEND:
NEW: neofetch --ascii \"\$(fortune | cowsay -W 30)\" NEW: neofetch --ascii \"\$(fortune | cowsay -W 30)\"
--caca source Shortcut to use 'caca' backend. --caca source Shortcut to use 'caca' backend.
--catimg source Shortcut to use 'catimg' backend.
--chafa source Shortcut to use 'chafa' backend. --chafa source Shortcut to use 'chafa' backend.
--iterm2 source Shortcut to use 'iterm2' backend. --iterm2 source Shortcut to use 'iterm2' backend.
--jp2a source Shortcut to use 'jp2a' backend. --jp2a source Shortcut to use 'jp2a' backend.
@ -4977,6 +4997,7 @@ IMAGE:
in some terminals emulators when using image mode. in some terminals emulators when using image mode.
--size 00px | --size 00% How to size the image. --size 00px | --size 00% How to size the image.
Possible values: auto, 00px, 00%, none Possible values: auto, 00px, 00%, none
--catimg_size 1/2 Change the resolution of catimg.
--crop_mode mode Which crop mode to use --crop_mode mode Which crop mode to use
Takes the values: normal, fit, fill Takes the values: normal, fit, fill
--crop_offset value Change the crop offset for normal mode. --crop_offset value Change the crop offset for normal mode.
@ -5128,8 +5149,8 @@ get_args() {
# Image backend # Image backend
"--backend") image_backend="$2" ;; "--backend") image_backend="$2" ;;
"--source") image_source="$2" ;; "--source") image_source="$2" ;;
"--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pot" |\ "--ascii" | "--caca" | "--catimg" | "--chafa" | "--jp2a" | "--iterm2" | "--off" |\
"--pixterm" | "--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty") "--pot" | "--pixterm" | "--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
image_backend="${1/--}" image_backend="${1/--}"
case $2 in case $2 in
"-"* | "") ;; "-"* | "") ;;
@ -5140,6 +5161,7 @@ get_args() {
# Image options # Image options
"--loop") image_loop="on" ;; "--loop") image_loop="on" ;;
"--image_size" | "--size") image_size="$2" ;; "--image_size" | "--size") image_size="$2" ;;
"--catimg_size") catimg_size="$2" ;;
"--crop_mode") crop_mode="$2" ;; "--crop_mode") crop_mode="$2" ;;
"--crop_offset") crop_offset="$2" ;; "--crop_offset") crop_offset="$2" ;;
"--xoffset") xoffset="$2" ;; "--xoffset") xoffset="$2" ;;
@ -8120,6 +8142,31 @@ ${c2} ``-:::::-``
EOF EOF
;; ;;
"Live Raizo"* | "Live_Raizo"*)
set_colors 3
read -rd '' ascii_data <<'EOF'
${c1} `......`
-+shmNMMMMMMNmhs/.
:smMMMMMmmhyyhmmMMMMMmo-
-hMMMMd+:. `----` .:odMMMMh-
`hMMMN+. .odNMMMMMMNdo. .yMMMMs`
hMMMd. -dMMMMmdhhdNMMMNh` .mMMMh
oMMMm` :MMMNs.:sddy:-sMMMN- `NMMM+
mMMMs dMMMo sMMMMMMd yMMMd sMMMm
----` .---` oNMMMMMh `---. .----
.sMMy:
/MM/
+dMMms.
hMMMMMMN
`dMMMMMMm:
.+ss+sMNysMMoomMd+ss+.
+MMMMMMN` +MM/ hMMMMMNs
sMMMMMMm-hNMMMd-hMMMMMMd
:yddh+`hMMMMMMN :yddy/`
.hMMMMd:
`..`
EOF
;;
"mx_small"*) "mx_small"*)
set_colors 4 6 7 set_colors 4 6 7
@ -9097,6 +9144,30 @@ ${c1} `..--..`
EOF EOF
;; ;;
"Quibian"*)
set_colors 3 7
read -rd '' ascii_data <<'EOF'
${c1} `.--::::::::--.`
`.-:::-..`` ``..-::-.`
.::::-` .${c2}+${c1}:`` `.-::.`
.::::.` -::::::-` `.::.
`-:::-` -:::::::::--..`` .::`
`::::- .${c2}oy${c1}:::::::---.```.: `::`
-:::: `.-:::::::::::-.``` `::
.::::.`-:::::::::::::. `:.
-::::.::::::::::::::: -:
::::::::::::::::::::` `:
:::::::::::::::::::- `:
::::::::::::::::::: --
.:::::::::::::::::` `:`
`::::::::::::::::: -`
.:::::::::::::::- -`
`::::::::::::::- `.`
.::::::::::::- ``
`.--:::::-.
EOF
;;
"Radix"*) "Radix"*)
set_colors 1 2 set_colors 1 2
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'