From 2a1788a11bc25744bbdae3d9844c6c1ac5ce557b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 17 Nov 2020 11:49:46 +0200 Subject: [PATCH 01/11] fix macOS issue. See #1607 --- neofetch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neofetch b/neofetch index 59e29d54..4cb397e7 100755 --- a/neofetch +++ b/neofetch @@ -4774,6 +4774,10 @@ cache_uname() { kernel_machine="${uname[2]}" 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}' \ "/System/Library/CoreServices/SystemVersion.plist")" for ((i=0;i<${#sw_vers[@]};i+=2)) { From cb6f10d8f4d924ed8f6d8ec429d6632674ce10e4 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 17 Nov 2020 18:35:33 +0200 Subject: [PATCH 02/11] fix whitespace --- neofetch | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/neofetch b/neofetch index 4cb397e7..37f2dbf7 100755 --- a/neofetch +++ b/neofetch @@ -7286,25 +7286,25 @@ EOF "Garuda"*) set_colors 7 7 read -rd '' ascii_data <<'EOF' -${c1} - .%;888:X8889888@8: - x;XxXB%8b8:b8%b88xx8: - .88Xx;; 8X8x:. - .tt8xX x8x8; - .t%xx8: Xxx.8: +${c1} + .%;888:X8889888@8: + x;XxXB%8b8:b8%b88xx8: + .88Xx;; 8X8x:. + .tt8xX x8x8; + .t%xx8: Xxx.8: .@8x8; x8xx@; ,tSXXX° .bbbbbbbbbbbbbbbbb8x@. .SXxx° bBBBBBBBBBBBBBBBBB:S;8. - ,888S° ;8SS - .@8@%° ;8: - <8X88/ - x%888 .@88@8@X@X8X@@X@X@8@Xx - .x8X@: bb8x8x8b8b8x8s8x88b88x; - .xxS88 .@8@;: - .x.88 .Xt@x; - .::SSX88@8b8B8B8b@@8Sxx; - .xq)9898999989989899° - + ,888S° ;8SS + .@8@%° ;8: + <8X88/ + x%888 .@88@8@X@X8X@@X@X@8@Xx + .x8X@: bb8x8x8b8b8x8s8x88b88x; + .xxS88 .@8@;: + .x.88 .Xt@x; + .::SSX88@8b8B8B8b@@8Sxx; + .xq)9898999989989899° + EOF ;; @@ -8553,7 +8553,7 @@ ${c1} ▟█████████████████▙ ${c2}▜█ ${c1} ▟███████████████████▙ ${c2}▜███▙ ${c1}▟██▙ ${c2} ▄▄▄▄▖ ▜███▙ ${c1}▟███▛ ${c2} ▟███▛ ▜██▛ ${c1}▟███▛ -${c2} ▟███▛ ▜▛ ${c1}▟███▛ +${c2} ▟███▛ ▜▛ ${c1}▟███▛ ${c2}▟███████████▛ ${c1}▟██████████▙ ${c2}▜██████████▛ ${c1}▟███████████▛ ${c2} ▟███▛ ${c1}▟▙ ▟███▛ From 2b39f58f749fa2641a4028419c6a9e20874a740c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 17 Nov 2020 18:43:32 +0200 Subject: [PATCH 03/11] disk: Fix bash 3.2 incompatibility. Closes #1586 --- neofetch | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/neofetch b/neofetch index 37f2dbf7..d650a7b0 100755 --- a/neofetch +++ b/neofetch @@ -3586,7 +3586,7 @@ get_disk() { for disk in "${disks[@]}"; do # Create a second array and make each element split at whitespace this time. IFS=" " read -ra disk_info <<< "$disk" - disk_perc=${disk_info[-2]/\%} + disk_perc=${disk_info[${#disk_info[@]} - 2]/\%} case $disk_percent in off) disk_perc= @@ -3594,29 +3594,34 @@ get_disk() { case $df_version in *befhikm*) - disk="$((disk_info[-4]/1024/1024))G / $((disk_info[-5]/1024/1024))G" - disk+="${disk_perc:+ ($disk_perc%)}" + disk=$((disk_info[${#disk_info[@]} - 4] / 1024 / 1024))G + 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 case $disk_subtitle in name) - disk_sub=${disk_info[*]::${#disk_info[@]}-5} + disk_sub=${disk_info[*]::${#disk_info[@]} - 5} ;; dir) - disk_sub=${disk_info[-1]/*\/} - disk_sub=${disk_sub:-${disk_info[-1]}} + disk_sub=${disk_info[${#disk_info[@]} - 1]/*\/} + disk_sub=${disk_sub:-${disk_info[${#disk_info[@]} - 1]}} ;; none) ;; *) - disk_sub=${disk_info[-1]} + disk_sub=${disk_info[${#disk_info[@]} - 1]} ;; esac From 494a7d8335cf0a2d815ea01b55401dbb4ae24ef9 Mon Sep 17 00:00:00 2001 From: Xaver Hellauer Date: Sat, 21 Nov 2020 17:34:34 +0100 Subject: [PATCH 04/11] Add support for `swupd` package manager (#1610) `swupd` is the default package manager of Clear Linux OS (they actually call their packages bundles). This patch adds support for swupd. --- neofetch | 1 + 1 file changed, 1 insertion(+) diff --git a/neofetch b/neofetch index d650a7b0..5b165dd0 100755 --- a/neofetch +++ b/neofetch @@ -1535,6 +1535,7 @@ get_packages() { has alps && tot alps showinstalled has butch && tot butch list has mine && tot mine -q + has swupd && tot swupd bundle-list --quiet # Counting files/dirs. # Variables need to be unquoted here. Only Bedrock Linux is affected. From d76d92f6b84c806e1b12e413eee443439c206947 Mon Sep 17 00:00:00 2001 From: SGS Date: Tue, 24 Nov 2020 04:47:07 +0100 Subject: [PATCH 05/11] New Garuda Neofetch Logo (#1613) Co-authored-by: SGSm --- neofetch | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/neofetch b/neofetch index 5b165dd0..2a6dd34f 100755 --- a/neofetch +++ b/neofetch @@ -7290,26 +7290,27 @@ EOF ;; "Garuda"*) - set_colors 7 7 + set_colors 7 7 3 7 2 4 read -rd '' ascii_data <<'EOF' -${c1} - .%;888:X8889888@8: - x;XxXB%8b8:b8%b88xx8: - .88Xx;; 8X8x:. - .tt8xX x8x8; - .t%xx8: Xxx.8: - .@8x8; x8xx@; - ,tSXXX° .bbbbbbbbbbbbbbbbb8x@. - .SXxx° bBBBBBBBBBBBBBBBBB:S;8. - ,888S° ;8SS - .@8@%° ;8: - <8X88/ - x%888 .@88@8@X@X8X@@X@X@8@Xx - .x8X@: bb8x8x8b8b8x8s8x88b88x; - .xxS88 .@8@;: - .x.88 .Xt@x; - .::SSX88@8b8B8B8b@@8Sxx; - .xq)9898999989989899° + +${c3} + .%;888:8898898: + x;XxXB%89b8:b8%b88: + .8Xxd 8X:. + .8Xx; 8x:. + .tt8x ${c6}.d${c3} x88; + .@8x8; ${c6}.db:${c3} xx@; + ${c4},tSXX° .bbbbbbbbbbbbbbbbbbbB8x@; + .SXxx bBBBBBBBBBBBBBBBBBBBbSBX8; + ,888S pd! + 8X88/ q + GBB. + ${c5}x%88 d888@8@X@X@X88X@@XX@@X@8@X. + dxXd dB8b8b8B8B08bB88b998888b88x. + dxx8o .@@;. + dx88 .t@x. + d:SS@8ba89aa67a853Sxxad. + .d988999889889899dd. EOF From d4f6abf1a87d1a6906f92f80931a9f402dbd45ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20L=C3=B6nnqvist?= Date: Tue, 24 Nov 2020 17:30:55 +0200 Subject: [PATCH 06/11] Refactor ueberzug (#1614) The previous way ueberzug was used is now deprecated. --- neofetch | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index 2a6dd34f..b2db1711 100755 --- a/neofetch +++ b/neofetch @@ -4327,15 +4327,14 @@ display_image() { if [ "$wait" = true ];then wait=false; else - source "$(ueberzug library)" - ImageLayer 0< <( - ImageLayer::add\ - ['identifier']="neofetch"\ - ['x']="$xoffset" ['y']="$yoffset"\ - ['max_width']="$((width / font_width))"\ - ['max_height']="$((height / font_height))"\ - ['path']="$image"; - read -rs; + ueberzug layer --parser bash 0< <( + declare -Ap ADD=(\ + [action]="add"\ + [identifier]="neofetch"\ + [x]=$xoffset [y]=$yoffset\ + [path]=$image\ + ) + read -rs ) fi ;; From df61458e7fa60e98a165520c3832b86dc3108ef0 Mon Sep 17 00:00:00 2001 From: Sekai Zhou Date: Wed, 25 Nov 2020 13:22:45 +0800 Subject: [PATCH 07/11] Fix font support for yakuake (#1615) Originally added in #1063, but did not actually work because it only looked for konsole processes (rather than yakuake's) when querying its session profile. --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index b2db1711..328cc1cd 100755 --- a/neofetch +++ b/neofetch @@ -3335,7 +3335,7 @@ END QT_BINDIR="$(qtpaths --binaries-dir)" && PATH+=":$QT_BINDIR" 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 IFS=$'\n' read -d "" -ra konsole_sessions <<< "$(qdbus "$i" | grep -F '/Sessions/')" From 2b559cb8c62088dcbe997f6bb5a27002a9c22e27 Mon Sep 17 00:00:00 2001 From: Iuri Jikidze <37273763+ijiki16@users.noreply.github.com> Date: Wed, 25 Nov 2020 01:09:10 -0800 Subject: [PATCH 08/11] Add Apple Music (#1611) * iTunes --> Music * add back iTunes * fix indentation * fix indentation 2 * ty vs code * fix ? --- neofetch | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/neofetch b/neofetch index 328cc1cd..4a625fe0 100755 --- a/neofetch +++ b/neofetch @@ -512,6 +512,7 @@ disk_percent="on" # guayadeque # io.elementary.music # iTunes +# Music # juk # lollypop # MellowPlayer @@ -2728,6 +2729,7 @@ get_song() { "guayadeque" "io.elementary.music" "iTunes" + "Music" "juk" "lollypop" "MellowPlayer" @@ -2842,6 +2844,12 @@ get_song() { string & "\n" & album of current track as¬ 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"*) song="$(banshee --query-artist --query-album --query-title |\ From 80174ea4d9b3f2e1fb35de8214b011275ed4b736 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 25 Nov 2020 14:09:31 +0200 Subject: [PATCH 09/11] neofetch: swap to apt for packages. Possible fix for #1616 --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 4a625fe0..7b68ffb3 100755 --- a/neofetch +++ b/neofetch @@ -1522,7 +1522,7 @@ get_packages() { has kiss && tot kiss l has cpt-list && tot cpt-list 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 xbps-query && tot xbps-query -l has apk && tot apk info @@ -2844,7 +2844,7 @@ get_song() { string & "\n" & album of current track as¬ 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¬ From bec3918bfdf383e4695f3308a50e1115a1064c18 Mon Sep 17 00:00:00 2001 From: Kanashimia <56224949+kanashimia@users.noreply.github.com> Date: Thu, 26 Nov 2020 07:11:09 +0200 Subject: [PATCH 10/11] NixOS - squash logo, add new package location. (#1617) * Decrease size of NixOS logo by one block. * Improve package counting for NixOS. --- neofetch | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/neofetch b/neofetch index 7b68ffb3..ed7116ae 100755 --- a/neofetch +++ b/neofetch @@ -1566,9 +1566,13 @@ get_packages() { } has nix-store && { - manager=nix-system && tot nix-store -q --requisites /run/current-system/sw - manager=nix-user && tot nix-store -q --requisites ~/.nix-profile - manager=nix-default && tot nix-store -q --requisites /nix/var/nix/profiles/default + nix-user-pkgs() { + 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-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. @@ -1607,8 +1611,12 @@ get_packages() { has pkgin && tot pkgin list has nix-store && { - manager=nix-system && tot nix-store -q --requisites "/run/current-system/sw" - manager=nix-user && tot nix-store -q --requisites "$HOME/.nix-profile" + nix-user-pkgs() { + 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 } ;; @@ -8559,7 +8567,7 @@ EOF "NixOS"*) set_colors 4 6 read -rd '' ascii_data <<'EOF' -${c1} ▗██▙ ${c2}▜███▙ ▟██▖ +${c1} ▗▄▄▄ ${c2}▗▄▄▄▄ ▄▄▄▖ ${c1} ▜███▙ ${c2}▜███▙ ▟███▛ ${c1} ▜███▙ ${c2}▜███▙▟███▛ ${c1} ▜███▙ ${c2}▜██████▛ @@ -8578,7 +8586,7 @@ ${c2} ▜▛ ${c1}▟████▙ ${c2}▜█████████ ${c1} ▟██████▙ ${c2}▜███▙ ${c1} ▟███▛▜███▙ ${c2}▜███▙ ${c1} ▟███▛ ▜███▙ ${c2}▜███▙ -${c1} ▝██▛ ▜███▙ ${c2}▜██▘ +${c1} ▝▀▀▀ ▀▀▀▀▘ ${c2}▀▀▀▘ EOF ;; From dc8a834888d9c93a007f766db8cbbbd889d69776 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 26 Nov 2020 07:15:09 +0200 Subject: [PATCH 11/11] neofetch: Fix naming conflict with mine. See #1616 --- neofetch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 7b68ffb3..051baf0e 100755 --- a/neofetch +++ b/neofetch @@ -1535,9 +1535,12 @@ get_packages() { has sorcery && tot gaze installed has alps && tot alps showinstalled 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. # Variables need to be unquoted here. Only Bedrock Linux is affected. # $br_prefix is fixed and won't change based on user input so this is safe either way.