From 4bc2a23a463745172419374c3142875d2f373445 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 14:44:52 +1000 Subject: [PATCH 01/10] packages: refactor --- neofetch | 170 ++++++++++++++++++++++------------------------------- neofetch.1 | 5 +- 2 files changed, 73 insertions(+), 102 deletions(-) diff --git a/neofetch b/neofetch index 86960457..1f291e85 100755 --- a/neofetch +++ b/neofetch @@ -144,6 +144,21 @@ os_arch="on" uptime_shorthand="on" +# Packages + + +# Show/Hide Package Manager names. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --package_manager +# +# Example: +# on: '900 (pacman, apt)' +# off: '900' +package_manager="on" + + # Shell @@ -1249,135 +1264,86 @@ get_uptime() { } get_packages() { + pkgs() { type -p "$1" >/dev/null && { ((packages+="$2")); managers+="$_, "; }; } + case "$os" in "Linux" | "BSD" | "iPhone OS" | "Solaris") - type -p pacman-key >/dev/null && \ - packages="$(pacman -Qq --color never | wc -l)" + pkgs "pacman-key" "$(pacman -Qq --color never | wc -l)" + pkgs "dpkg" "$(dpkg --get-selections | grep -cv deinstall$)" + pkgs "rpm" "$(rpm -qa | wc -l)" + pkgs "xbps-query" "$(xbps-query -l | wc -l)" + pkgs "apk" "$(apk info | wc -l)" + pkgs "opkg" "$(opkg list-installed | wc -l)" + pkgs "pacman-g2" "$(pacman-g2 -Q | wc -l)" + pkgs "lvu" "$(lvu installed | wc -l)" + pkgs "tce-status" "$(tce-status -i | wc -l)" + pkgs "pkg_info" "$(pkg_info | wc -l)" + pkgs "tazpkg" "$(tazpkg list | wc -l) - 6" + pkgs "sorcery" "$(gaze installed | wc -l)" + pkgs "alps" "$(alps showinstalled | wc -l)" + pkgs "butch" "$(butch list | wc -l)" + pkgs "kpm-pkg" "$(kpm --get-selections | grep -cv deinstall$)" + pkgs "emerge" "$(ls -d /var/db/pkg/*/* | wc -l)" + pkgs "nix-env" "$(ls -d -1 /nix/store/*/ | wc -l)" + pkgs "guix" "$(ls -d -1 /gnu/store/*/ | wc -l)" + pkgs "Compile" "$(ls -d -1 /Programs/*/ | wc -l)" + pkgs "eopkg" "$(ls -1 /var/lib/eopkg/package | wc -l)" + pkgs "crew" "$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l)" + pkgs "pkgtool" "$(ls -1 /var/log/packages | wc -l)" + pkgs "cave" "$(ls -d -1 /var/db/paludis/repositories/cross-installed/*/data/* \ + /var/db/paludis/repositories/installed/data/* | wc -l)" - type -p dpkg >/dev/null && \ - ((packages+=$(dpkg --get-selections | grep -cv deinstall$))) + case "$kernel_name" in + "FreeBSD") pkgs "pkg" "$(pkg info | wc -l)" ;; + "Solaris") pkgs "pkginfo" "$(pkginfo -i | wc -l)" ;; - type -p pkgtool >/dev/null && \ - ((packages+=$(ls -1 /var/log/packages | wc -l))) + *) + pkgs "pkg" "$(ls -1 /var/db/pkg | wc -l)" - type -p rpm >/dev/null && \ - ((packages+=$(rpm -qa | wc -l))) - - type -p xbps-query >/dev/null && \ - ((packages+=$(xbps-query -l | wc -l))) - - [[ "$os" != "Linux" ]] && type -p pkginfo >/dev/null && \ - ((packages+=$(pkginfo -i | wc -l))) - - type -p emerge >/dev/null && \ - ((packages+=$(ls -d /var/db/pkg/*/* | wc -l))) - - type -p nix-env >/dev/null && \ - ((packages+=$(ls -d -1 /nix/store/*/ | wc -l))) - - type -p guix >/dev/null && \ - ((packages+=$(ls -d -1 /gnu/store/*/ | wc -l))) - - type -p apk >/dev/null && \ - ((packages+=$(apk info | wc -l))) - - type -p opkg >/dev/null && \ - ((packages+=$(opkg list-installed | wc -l))) - - type -p pacman-g2 >/dev/null && \ - ((packages+=$(pacman-g2 -Q | wc -l))) - - type -p lvu >/dev/null && \ - ((packages+=$(lvu installed | wc -l))) - - type -p tce-status >/dev/null && \ - ((packages+=$(tce-status -i | wc -l))) - - type -p Compile >/dev/null && \ - ((packages+=$(ls -d -1 /Programs/*/ | wc -l))) - - type -p eopkg >/dev/null && \ - ((packages+=$(ls -1 /var/lib/eopkg/package | wc -l))) - - type -p pkg_info >/dev/null && \ - ((packages+=$(pkg_info | wc -l))) - - type -p crew >/dev/null && \ - ((packages+=$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l))) - - type -p tazpkg >/dev/null && \ - ((packages+=$(tazpkg list | wc -l) - 6)) - - type -p sorcery >/dev/null && \ - ((packages+=$(gaze installed | wc -l))) - - type -p alps >/dev/null && \ - ((packages+=$(alps showinstalled | wc -l))) - - type -p kpt >/dev/null && \ - type -p kpm >/dev/null && \ - ((packages+=$(kpm --get-selections | grep -cv deinstall$))) - - if type -p cave >/dev/null; then - package_dir=(/var/db/paludis/repositories/{cross-installed/*,installed}/data/*) - ((packages+=$(ls -d -1 "${package_dir[@]}" | wc -l))) - fi - - type -p butch >/dev/null && \ - ((packages+=$(butch list | wc -l))) - - if type -p pkg >/dev/null; then - case "$kernel_name" in - "FreeBSD") ((packages+=$(pkg info | wc -l))) ;; - *) - ((packages+=$(ls -1 /var/db/pkg | wc -l))) - ((packages == 0)) && ((packages+=$(pkg list | wc -l))) - esac - fi + ((packages == 0)) && \ + pkgs "pkg" "$(pkg list | wc -l)" + ;; + esac ;; "Mac OS X" | "MINIX") - type -p port >/dev/null && \ - ((packages+=$(port installed | wc -l) - 1)) + pkgs "port" "$(port installed | wc -l) - 1)" + pkgs "brew" "$(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1)" + pkgs "pkgin" "$(pkgin list | wc -l)" + ;; - type -p brew >/dev/null && \ - ((packages+=$(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1)) - - type -p pkgin >/dev/null && \ - ((packages+=$(pkgin list | wc -l))) + "AIX"| "FreeMiNT") + pkgs "lslpp" "$(lslpp -J -l -q | grep -cv '^#')" + pkgs "rpm" "$(rpm -qa | wc -l)" ;; "Windows") case "$kernel_name" in - "CYGWIN"*) packages="$(cygcheck -cd | wc -l)" ;; - "MSYS"*) packages="$(pacman -Qq --color never | wc -l)" + "CYGWIN"*) pkgs "cygcheck" "$(cygcheck -cd | wc -l)" ;; + "MSYS"*) pkgs "pacman" "$(pacman -Qq --color never | wc -l)" ;; esac # Count chocolatey packages. [[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \ - ((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l))) + pkgs ":" "$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)" ;; "Haiku") packages="$(ls -1 /boot/system/package-links | wc -l)" ;; - "AIX") - packages="$(lslpp -J -l -q | grep -cv '^#')" - ((packages+=$(rpm -qa | wc -l))) - ;; - "IRIX") packages="$(($(versions -b | wc -l)-3))" ;; - - "FreeMiNT") - type -p rpm >/dev/null && \ - packages="$(rpm -qa | wc -l)" - ;; esac - ((packages == 0)) && unset packages + if ((packages == 0)); then + unset packages + + elif [[ "$package_manager" == "on" ]]; then + managers="${managers/pacman-key/pacman}" + packages+=" (${managers::-2})" + fi } get_shell() { @@ -4398,6 +4364,7 @@ INFO: NOTE: You can supply multiple args. eg. 'neofetch --disable cpu gpu' + --package_manager on/off Hide/Show Package Manager names. --os_arch on/off Hide/Show OS architecture. --speed_type type Change the type of cpu speed to display. Possible values: current, min, max, bios, @@ -4593,6 +4560,7 @@ get_args() { while [[ "$1" ]]; do case "$1" in # Info + "--package_manager") package_manager="$2" ;; "--os_arch") os_arch="$2" ;; "--cpu_cores") cpu_cores="$2" ;; "--cpu_speed") cpu_speed="$2" ;; diff --git a/neofetch.1 b/neofetch.1 index 4bfa57ab..6359a76a 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. -.TH NEOFETCH "1" "May 2018" "Neofetch 4.0.3" "User Commands" +.TH NEOFETCH "1" "June 2018" "Neofetch 4.0.3" "User Commands" .SH NAME Neofetch \- A fast, highly customizable system info script .SH SYNOPSIS @@ -22,6 +22,9 @@ For example: 'info "Memory" memory' would be '\-\-disable memory' .IP NOTE: You can supply multiple args. eg. 'neofetch \fB\-\-disable\fR cpu gpu' .TP +\fB\-\-package_manager\fR on/off +Hide/Show Package Manager names. +.TP \fB\-\-os_arch\fR on/off Hide/Show OS architecture. .TP From 75f845c7afec5019396a719dc7ff8be61fd136e3 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 14:52:08 +1000 Subject: [PATCH 02/10] packages: refactor --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 1f291e85..95f7f220 100755 --- a/neofetch +++ b/neofetch @@ -1307,8 +1307,8 @@ get_packages() { ;; "Mac OS X" | "MINIX") - pkgs "port" "$(port installed | wc -l) - 1)" - pkgs "brew" "$(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1)" + pkgs "port" "$(port installed | wc -l) - 1" + pkgs "brew" "$(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1" pkgs "pkgin" "$(pkgin list | wc -l)" ;; From dc9b5519fdbd5217c4f068ca3c6cf348cb07f0b5 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 14:54:11 +1000 Subject: [PATCH 03/10] packages: refactor --- neofetch | 1 + 1 file changed, 1 insertion(+) diff --git a/neofetch b/neofetch index 95f7f220..dc799d08 100755 --- a/neofetch +++ b/neofetch @@ -1342,6 +1342,7 @@ get_packages() { elif [[ "$package_manager" == "on" ]]; then managers="${managers/pacman-key/pacman}" + managers="${managers/kpt-pkg/kpt}" packages+=" (${managers::-2})" fi } From c03c9e12480ea18117d239625eea0faf9f10e6b0 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 15:02:34 +1000 Subject: [PATCH 04/10] packages: refactor --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index dc799d08..9df45df9 100755 --- a/neofetch +++ b/neofetch @@ -1343,7 +1343,7 @@ get_packages() { elif [[ "$package_manager" == "on" ]]; then managers="${managers/pacman-key/pacman}" managers="${managers/kpt-pkg/kpt}" - packages+=" (${managers::-2})" + packages+=" (${managers%,*})" fi } From 9bf46946b6a11be5805b8996560a4ec247621dce Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 15:04:27 +1000 Subject: [PATCH 05/10] packages: Remove find usage from brew --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 9df45df9..25c4a010 100755 --- a/neofetch +++ b/neofetch @@ -1308,7 +1308,7 @@ get_packages() { "Mac OS X" | "MINIX") pkgs "port" "$(port installed | wc -l) - 1" - pkgs "brew" "$(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1" + pkgs "brew" "$(files=(/usr/local/Cellar/*) && ((packages+=${#files[@]}))) - 1" pkgs "pkgin" "$(pkgin list | wc -l)" ;; From 3051bbc424a44ffb90597ac4516fe1b49afde6fb Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 15:43:53 +1000 Subject: [PATCH 06/10] packages: Remove ls usage --- neofetch | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/neofetch b/neofetch index 25c4a010..195c25dc 100755 --- a/neofetch +++ b/neofetch @@ -1283,22 +1283,23 @@ get_packages() { pkgs "alps" "$(alps showinstalled | wc -l)" pkgs "butch" "$(butch list | wc -l)" pkgs "kpm-pkg" "$(kpm --get-selections | grep -cv deinstall$)" - pkgs "emerge" "$(ls -d /var/db/pkg/*/* | wc -l)" - pkgs "nix-env" "$(ls -d -1 /nix/store/*/ | wc -l)" - pkgs "guix" "$(ls -d -1 /gnu/store/*/ | wc -l)" - pkgs "Compile" "$(ls -d -1 /Programs/*/ | wc -l)" - pkgs "eopkg" "$(ls -1 /var/lib/eopkg/package | wc -l)" - pkgs "crew" "$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l)" - pkgs "pkgtool" "$(ls -1 /var/log/packages | wc -l)" - pkgs "cave" "$(ls -d -1 /var/db/paludis/repositories/cross-installed/*/data/* \ - /var/db/paludis/repositories/installed/data/* | wc -l)" + pkgs "emerge" "$(files=(/var/db/pkg/*/*/) && echo ${#files[@]})" + pkgs "nix-env" "$(files=(/nix/store/*/) && echo ${#files[@]})" + pkgs "guix" "$(files=(/gnu/store/*/) && echo ${#files[@]})" + pkgs "Compile" "$(files=(/Programs/*/) && echo ${#files[@]})" + pkgs "eopkg" "$(files=(/var/lib/eopkg/package/*) && echo ${#files[@]})" + pkgs "crew" "$(files=(/usr/local/etc/crew/meta/*.filelist) && echo ${#files[@]})" + pkgs "pkgtool" "$(files=(/var/log/packages/*) && echo ${#files[@]})" + pkgs "cave" "$(files=(/var/db/paludis/repositories/cross-installed/*/data/*/ + /var/db/paludis/repositories/installed/data/*/) && \ + echo ${#files[@]})" case "$kernel_name" in "FreeBSD") pkgs "pkg" "$(pkg info | wc -l)" ;; "Solaris") pkgs "pkginfo" "$(pkginfo -i | wc -l)" ;; *) - pkgs "pkg" "$(ls -1 /var/db/pkg | wc -l)" + pkgs "pkg" "$(files=(/var/db/pkg/*) && echo ${#files[@]})" ((packages == 0)) && \ pkgs "pkg" "$(pkg list | wc -l)" @@ -1325,11 +1326,12 @@ get_packages() { # Count chocolatey packages. [[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \ - pkgs ":" "$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)" + pkgs ":" "$(files=(/cygdrive/c/ProgramData/chocolatey/lib/*) && echo ${#files[@]})" ;; "Haiku") - packages="$(ls -1 /boot/system/package-links | wc -l)" + files=(/boot/system/package-links/*) + packages="${#files[@]}" ;; "IRIX") From 094fca97bf0bb279448b54416ef36112d6233785 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 16:19:29 +1000 Subject: [PATCH 07/10] packages: Remove wc usage --- neofetch | 75 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/neofetch b/neofetch index 195c25dc..7267ec65 100755 --- a/neofetch +++ b/neofetch @@ -1265,68 +1265,69 @@ get_uptime() { get_packages() { pkgs() { type -p "$1" >/dev/null && { ((packages+="$2")); managers+="$_, "; }; } + tots() { IFS=$'\n' read -d "" -ra files < <($1); echo "${#files[@]}"; } + dirc() { echo $#; } case "$os" in "Linux" | "BSD" | "iPhone OS" | "Solaris") - pkgs "pacman-key" "$(pacman -Qq --color never | wc -l)" + pkgs "pacman-key" "$(tots "pacman -Qq --color never")" + pkgs "rpm" "$(tots "rpm -qa")" + pkgs "xbps-query" "$(tots "xbps-query -l")" + pkgs "apk" "$(tots "apk info")" + pkgs "opkg" "$(tots "opkg list-installed")" + pkgs "pacman-g2" "$(tots "pacman-g2 -Q")" + pkgs "lvu" "$(tots "lvu installed")" + pkgs "tce-status" "$(tots "tce-status -i")" + pkgs "pkg_info" "$(tots "pkg_info")" + pkgs "tazpkg" "$(tots "tazpkg list") - 6" + pkgs "sorcery" "$(tots "gaze installed")" + pkgs "alps" "$(tots "alps showinstalled")" + pkgs "butch" "$(tots "butch list")" + pkgs "emerge" "$(dirc /var/db/pkg/*/*/)" + pkgs "nix-env" "$(dirc /nix/store/*/)" + pkgs "guix" "$(dirc /gnu/store/*/)" + pkgs "Compile" "$(dirc /Programs/*/)" + pkgs "eopkg" "$(dirc /var/lib/eopkg/package/*)" + pkgs "crew" "$(dirc /usr/local/etc/crew/meta/*.filelist)" + pkgs "pkgtool" "$(dirc /var/log/packages/*)" + pkgs "cave" "$(dirc /var/db/paludis/repositories/cross-installed/*/data/*/ \ + /var/db/paludis/repositories/installed/data/*/)" + pkgs "kpm-pkg" "$(kpm --get-selections | grep -cv deinstall$)" pkgs "dpkg" "$(dpkg --get-selections | grep -cv deinstall$)" - pkgs "rpm" "$(rpm -qa | wc -l)" - pkgs "xbps-query" "$(xbps-query -l | wc -l)" - pkgs "apk" "$(apk info | wc -l)" - pkgs "opkg" "$(opkg list-installed | wc -l)" - pkgs "pacman-g2" "$(pacman-g2 -Q | wc -l)" - pkgs "lvu" "$(lvu installed | wc -l)" - pkgs "tce-status" "$(tce-status -i | wc -l)" - pkgs "pkg_info" "$(pkg_info | wc -l)" - pkgs "tazpkg" "$(tazpkg list | wc -l) - 6" - pkgs "sorcery" "$(gaze installed | wc -l)" - pkgs "alps" "$(alps showinstalled | wc -l)" - pkgs "butch" "$(butch list | wc -l)" - pkgs "kpm-pkg" "$(kpm --get-selections | grep -cv deinstall$)" - pkgs "emerge" "$(files=(/var/db/pkg/*/*/) && echo ${#files[@]})" - pkgs "nix-env" "$(files=(/nix/store/*/) && echo ${#files[@]})" - pkgs "guix" "$(files=(/gnu/store/*/) && echo ${#files[@]})" - pkgs "Compile" "$(files=(/Programs/*/) && echo ${#files[@]})" - pkgs "eopkg" "$(files=(/var/lib/eopkg/package/*) && echo ${#files[@]})" - pkgs "crew" "$(files=(/usr/local/etc/crew/meta/*.filelist) && echo ${#files[@]})" - pkgs "pkgtool" "$(files=(/var/log/packages/*) && echo ${#files[@]})" - pkgs "cave" "$(files=(/var/db/paludis/repositories/cross-installed/*/data/*/ - /var/db/paludis/repositories/installed/data/*/) && \ - echo ${#files[@]})" case "$kernel_name" in - "FreeBSD") pkgs "pkg" "$(pkg info | wc -l)" ;; - "Solaris") pkgs "pkginfo" "$(pkginfo -i | wc -l)" ;; + "FreeBSD") pkgs "pkg" "$(tots "pkg info")" ;; + "SunOS") pkgs "pkginfo" "$(tots "pkginfo -i")" ;; *) - pkgs "pkg" "$(files=(/var/db/pkg/*) && echo ${#files[@]})" + pkgs "pkg" "$(dirc /var/db/pkg/*)" ((packages == 0)) && \ - pkgs "pkg" "$(pkg list | wc -l)" + pkgs "pkg" "$(tots "pkg list")" ;; esac ;; "Mac OS X" | "MINIX") - pkgs "port" "$(port installed | wc -l) - 1" - pkgs "brew" "$(files=(/usr/local/Cellar/*) && ((packages+=${#files[@]}))) - 1" - pkgs "pkgin" "$(pkgin list | wc -l)" + pkgs "port" "$(tots "port installed") - 1" + pkgs "brew" "$(dirc /usr/local/Cellar/*) - 1" + pkgs "pkgin" "$(tots "pkgin list")" ;; "AIX"| "FreeMiNT") pkgs "lslpp" "$(lslpp -J -l -q | grep -cv '^#')" - pkgs "rpm" "$(rpm -qa | wc -l)" + pkgs "rpm" "$(tots "rpm -qa")" ;; "Windows") case "$kernel_name" in - "CYGWIN"*) pkgs "cygcheck" "$(cygcheck -cd | wc -l)" ;; - "MSYS"*) pkgs "pacman" "$(pacman -Qq --color never | wc -l)" ;; + "CYGWIN"*) pkgs "cygcheck" "$(tots "cygcheck -cd")" ;; + "MSYS"*) pkgs "pacman" "$(tots "pacman -Qq --color never")" ;; esac # Count chocolatey packages. [[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \ - pkgs ":" "$(files=(/cygdrive/c/ProgramData/chocolatey/lib/*) && echo ${#files[@]})" + pkgs ":" "$(dirc /cygdrive/c/ProgramData/chocolatey/lib/*)" ;; "Haiku") @@ -1335,14 +1336,14 @@ get_packages() { ;; "IRIX") - packages="$(($(versions -b | wc -l)-3))" + packages="$(($(tots "versions -b")-3))" ;; esac if ((packages == 0)); then unset packages - elif [[ "$package_manager" == "on" ]]; then + elif [[ "$package_manager" == "on" && "${managers//,}" ]]; then managers="${managers/pacman-key/pacman}" managers="${managers/kpt-pkg/kpt}" packages+=" (${managers%,*})" From e3afa265f97e10161ff379890b6f7f482978791e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 2 Jun 2018 16:31:21 +1000 Subject: [PATCH 08/10] packages: only show manager when packages > 0 --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 7267ec65..12e35f18 100755 --- a/neofetch +++ b/neofetch @@ -1264,7 +1264,7 @@ get_uptime() { } get_packages() { - pkgs() { type -p "$1" >/dev/null && { ((packages+="$2")); managers+="$_, "; }; } + pkgs() { type -p "$1" >/dev/null && { ((packages+="$2"));(("$2">0))&&managers+="$_, "; }; } tots() { IFS=$'\n' read -d "" -ra files < <($1); echo "${#files[@]}"; } dirc() { echo $#; } From 1c015aea18bd84bad37330235021839502ec9ca2 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 3 Jun 2018 06:59:24 +1000 Subject: [PATCH 09/10] travis: Remove lint exceptions. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aac1b2fc..78b7d757 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ script: - time ./neofetch --travis -v # See this wiki page for why we're disabling these errors. # https://github.com/dylanaraps/neofetch/wiki/Shellcheck-Exclusions - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck neofetch -e SC1090,SC2009,SC2012,SC2016,SC2034,SC2128,SC2153,SC2154,SC2178,SC2010,SC1004,SC1091,SC1117; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck neofetch; fi # The if statement is here to invert the exit code from grep. # grep normally errors if no match is found but we want the opposite. # We invert it so grep fails if a match is found. From 4698dbd06e965004f0923bfe82fc2804b6b6093f Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 3 Jun 2018 07:07:52 +1000 Subject: [PATCH 10/10] misc: Surpress last lint errors as they are intended behavior --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 12e35f18..a98b72a9 100755 --- a/neofetch +++ b/neofetch @@ -1,7 +1,7 @@ #!/usr/bin/env bash # vim: noai:ts=4:sw=4:expandtab # shellcheck source=/dev/null -# shellcheck disable=2016,2009 +# shellcheck disable=2009,2012,2016 # # Neofetch: A command-line system information tool written in bash 3.2+. # https://github.com/dylanaraps/neofetch