Merge upstream changes.
This commit is contained in:
Syphist 2021-01-08 20:43:15 -06:00
commit 1456af01ba

125
neofetch
View file

@ -512,6 +512,7 @@ disk_percent="on"
# guayadeque # guayadeque
# io.elementary.music # io.elementary.music
# iTunes # iTunes
# Music
# juk # juk
# lollypop # lollypop
# MellowPlayer # MellowPlayer
@ -1521,7 +1522,7 @@ get_packages() {
has kiss && tot kiss l has kiss && tot kiss l
has cpt-list && tot cpt-list has cpt-list && tot cpt-list
has pacman-key && tot pacman -Qq --color never has pacman-key && tot pacman -Qq --color never
has dpkg && tot dpkg-query -f '.\n' -W has apt && tot apt list
has rpm && tot rpm -qa has rpm && tot rpm -qa
has xbps-query && tot xbps-query -l has xbps-query && tot xbps-query -l
has apk && tot apk info has apk && tot apk info
@ -1534,7 +1535,11 @@ get_packages() {
has sorcery && tot gaze installed has sorcery && tot gaze installed
has alps && tot alps showinstalled has alps && tot alps showinstalled
has butch && tot butch list has butch && tot butch list
has mine && tot mine -q has swupd && tot swupd bundle-list --quiet
# 'mine' conflicts with minesweeper games.
[[ -f /etc/SDE-VERSION ]] &&
has mine && tot mine -q
# Counting files/dirs. # Counting files/dirs.
# Variables need to be unquoted here. Only Bedrock Linux is affected. # Variables need to be unquoted here. Only Bedrock Linux is affected.
@ -1564,9 +1569,13 @@ get_packages() {
} }
has nix-store && { has nix-store && {
manager=nix-system && tot nix-store -q --requisites /run/current-system/sw nix-user-pkgs() {
manager=nix-user && tot nix-store -q --requisites ~/.nix-profile nix-store -qR ~/.nix-profile
manager=nix-default && tot nix-store -q --requisites /nix/var/nix/profiles/default nix-store -qR /etc/profiles/per-user/"$USER"
}
manager=nix-system && tot nix-store -qR /run/current-system/sw
manager=nix-user && tot nix-user-pkgs
manager=nix-default && tot nix-store -qR /nix/var/nix/profiles/default
} }
# pkginfo is also the name of a python package manager which is painfully slow. # pkginfo is also the name of a python package manager which is painfully slow.
@ -1605,8 +1614,12 @@ get_packages() {
has pkgin && tot pkgin list has pkgin && tot pkgin list
has nix-store && { has nix-store && {
manager=nix-system && tot nix-store -q --requisites "/run/current-system/sw" nix-user-pkgs() {
manager=nix-user && tot nix-store -q --requisites "$HOME/.nix-profile" nix-store -qR ~/.nix-profile
nix-store -qR /etc/profiles/per-user/"$USER"
}
manager=nix-system && tot nix-store -qR /run/current-system/sw
manager=nix-user && tot nix-store -qR nix-user-pkgs
} }
;; ;;
@ -2727,6 +2740,7 @@ get_song() {
"guayadeque" "guayadeque"
"io.elementary.music" "io.elementary.music"
"iTunes" "iTunes"
"Music"
"juk" "juk"
"lollypop" "lollypop"
"MellowPlayer" "MellowPlayer"
@ -2842,6 +2856,12 @@ get_song() {
string & "\n" & name of current track as string')" string & "\n" & name of current track as string')"
;; ;;
"music"*)
song="$(osascript -e 'tell application "Music" to artist of current track as¬
string & "\n" & album of current track as¬
string & "\n" & name of current track as string')"
;;
"banshee"*) "banshee"*)
song="$(banshee --query-artist --query-album --query-title |\ song="$(banshee --query-artist --query-album --query-title |\
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2} awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
@ -3334,7 +3354,7 @@ END
QT_BINDIR="$(qtpaths --binaries-dir)" && PATH+=":$QT_BINDIR" QT_BINDIR="$(qtpaths --binaries-dir)" && PATH+=":$QT_BINDIR"
IFS=$'\n' read -d "" -ra konsole_instances \ IFS=$'\n' read -d "" -ra konsole_instances \
<<< "$(qdbus | awk '/org.kde.konsole/ {print $1}')" <<< "$(qdbus | awk '/org.kde.'"$term"'/ {print $1}')"
for i in "${konsole_instances[@]}"; do for i in "${konsole_instances[@]}"; do
IFS=$'\n' read -d "" -ra konsole_sessions <<< "$(qdbus "$i" | grep -F '/Sessions/')" IFS=$'\n' read -d "" -ra konsole_sessions <<< "$(qdbus "$i" | grep -F '/Sessions/')"
@ -3586,7 +3606,7 @@ get_disk() {
for disk in "${disks[@]}"; do for disk in "${disks[@]}"; do
# Create a second array and make each element split at whitespace this time. # Create a second array and make each element split at whitespace this time.
IFS=" " read -ra disk_info <<< "$disk" IFS=" " read -ra disk_info <<< "$disk"
disk_perc=${disk_info[-2]/\%} disk_perc=${disk_info[${#disk_info[@]} - 2]/\%}
case $disk_percent in case $disk_percent in
off) disk_perc= off) disk_perc=
@ -3594,29 +3614,34 @@ get_disk() {
case $df_version in case $df_version in
*befhikm*) *befhikm*)
disk="$((disk_info[-4]/1024/1024))G / $((disk_info[-5]/1024/1024))G" disk=$((disk_info[${#disk_info[@]} - 4] / 1024 / 1024))G
disk+="${disk_perc:+ ($disk_perc%)}" disk+=" / "
disk+=$((disk_info[${#disk_info[@]} - 5] / 1024/ 1024))G
disk+=${disk_perc:+ ($disk_perc%)}
;; ;;
*) *)
disk="${disk_info[-4]/i} / ${disk_info[-5]/i}${disk_perc:+ ($disk_perc%)}" disk=${disk_info[${#disk_info[@]} - 4]/i}
disk+=" / "
disk+=${disk_info[${#disk_info[@]} - 5]/i}
disk+=${disk_perc:+ ($disk_perc%)}
;; ;;
esac esac
case $disk_subtitle in case $disk_subtitle in
name) name)
disk_sub=${disk_info[*]::${#disk_info[@]}-5} disk_sub=${disk_info[*]::${#disk_info[@]} - 5}
;; ;;
dir) dir)
disk_sub=${disk_info[-1]/*\/} disk_sub=${disk_info[${#disk_info[@]} - 1]/*\/}
disk_sub=${disk_sub:-${disk_info[-1]}} disk_sub=${disk_sub:-${disk_info[${#disk_info[@]} - 1]}}
;; ;;
none) ;; none) ;;
*) *)
disk_sub=${disk_info[-1]} disk_sub=${disk_info[${#disk_info[@]} - 1]}
;; ;;
esac esac
@ -4345,15 +4370,14 @@ display_image() {
if [ "$wait" = true ];then if [ "$wait" = true ];then
wait=false; wait=false;
else else
source "$(ueberzug library)" ueberzug layer --parser bash 0< <(
ImageLayer 0< <( declare -Ap ADD=(\
ImageLayer::add\ [action]="add"\
['identifier']="neofetch"\ [identifier]="neofetch"\
['x']="$xoffset" ['y']="$yoffset"\ [x]=$xoffset [y]=$yoffset\
['max_width']="$((width / font_width))"\ [path]=$image\
['max_height']="$((height / font_height))"\ )
['path']="$image"; read -rs
read -rs;
) )
fi fi
;; ;;
@ -4798,6 +4822,10 @@ cache_uname() {
kernel_machine="${uname[2]}" kernel_machine="${uname[2]}"
if [[ "$kernel_name" == "Darwin" ]]; then if [[ "$kernel_name" == "Darwin" ]]; then
# macOS can report incorrect versions unless this is 0.
# https://github.com/dylanaraps/neofetch/issues/1607
export SYSTEM_VERSION_COMPAT=0
IFS=$'\n' read -d "" -ra sw_vers <<< "$(awk -F'<|>' '/key|string/ {print $3}' \ IFS=$'\n' read -d "" -ra sw_vers <<< "$(awk -F'<|>' '/key|string/ {print $3}' \
"/System/Library/CoreServices/SystemVersion.plist")" "/System/Library/CoreServices/SystemVersion.plist")"
for ((i=0;i<${#sw_vers[@]};i+=2)) { for ((i=0;i<${#sw_vers[@]};i+=2)) {
@ -7304,27 +7332,28 @@ EOF
;; ;;
"Garuda"*) "Garuda"*)
set_colors 7 7 set_colors 7 7 3 7 2 4
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c1}
.%;888:X8889888@8: ${c3}
x;XxXB%8b8:b8%b88xx8: .%;888:8898898:
.88Xx;; 8X8x:. x;XxXB%89b8:b8%b88:
.tt8xX x8x8; .8Xxd 8X:.
.t%xx8: Xxx.8: .8Xx; 8x:.
.@8x8; x8xx@; .tt8x ${c6}.d${c3} x88;
,tSXXX° .bbbbbbbbbbbbbbbbb8x@. .@8x8; ${c6}.db:${c3} xx@;
.SXxx° bBBBBBBBBBBBBBBBBB:S;8. ${c4},tSXX° .bbbbbbbbbbbbbbbbbbbB8x@;
,888S° ;8SS .SXxx bBBBBBBBBBBBBBBBBBBBbSBX8;
.@8@%° ;8: ,888S pd!
<8X88/ 8X88/ q
x%888 .@88@8@X@X8X@@X@X@8@Xx GBB.
.x8X@: bb8x8x8b8b8x8s8x88b88x; ${c5}x%88 d888@8@X@X@X88X@@XX@@X@8@X.
.xxS88 .@8@;: dxXd dB8b8b8B8B08bB88b998888b88x.
.x.88 .Xt@x; dxx8o .@@;.
.::SSX88@8b8B8B8b@@8Sxx; dx88 .t@x.
.xq)9898999989989899° d:SS@8ba89aa67a853Sxxad.
.d988999889889899dd.
EOF EOF
;; ;;
@ -8565,7 +8594,7 @@ EOF
"NixOS"*) "NixOS"*)
set_colors 4 6 set_colors 4 6
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c1} ▗██▙ ${c2}▜███▙ ▟██ ${c1} ▗▄▄▄ ${c2}▗▄▄▄▄ ▄▄▄
${c1} ▜███▙ ${c2}▜███▙ ▟███▛ ${c1} ▜███▙ ${c2}▜███▙ ▟███▛
${c1} ▜███▙ ${c2}▜███▙▟███▛ ${c1} ▜███▙ ${c2}▜███▙▟███▛
${c1} ▜███▙ ${c2}▜██████▛ ${c1} ▜███▙ ${c2}▜██████▛
@ -8573,7 +8602,7 @@ ${c1} ▟█████████████████▙ ${c2}▜█
${c1} ▟███████████████████▙ ${c2}▜███▙ ${c1}▟██▙ ${c1} ▟███████████████████▙ ${c2}▜███▙ ${c1}▟██▙
${c2} ▄▄▄▄▖ ▜███▙ ${c1}▟███▛ ${c2} ▄▄▄▄▖ ▜███▙ ${c1}▟███▛
${c2} ▟███▛ ▜██▛ ${c1}▟███▛ ${c2} ▟███▛ ▜██▛ ${c1}▟███▛
${c2} ▟███▛ ▜▛ ${c1}▟███▛ ${c2} ▟███▛ ▜▛ ${c1}▟███▛
${c2}▟███████████▛ ${c1}▟██████████▙ ${c2}▟███████████▛ ${c1}▟██████████▙
${c2}▜██████████▛ ${c1}▟███████████▛ ${c2}▜██████████▛ ${c1}▟███████████▛
${c2} ▟███▛ ${c1}▟▙ ▟███▛ ${c2} ▟███▛ ${c1}▟▙ ▟███▛
@ -8584,7 +8613,7 @@ ${c2} ▜▛ ${c1}▟████▙ ${c2}▜█████████
${c1} ▟██████▙ ${c2}▜███▙ ${c1} ▟██████▙ ${c2}▜███▙
${c1} ▟███▛▜███▙ ${c2}▜███▙ ${c1} ▟███▛▜███▙ ${c2}▜███▙
${c1} ▟███▛ ▜███▙ ${c2}▜███▙ ${c1} ▟███▛ ▜███▙ ${c2}▜███▙
${c1} ▝██▛ ▜███▙ ${c2}▜██ ${c1} ▝▀▀▀ ▀▀▀▀▘ ${c2}▀▀▀
EOF EOF
;; ;;