From 3ed4c436368ea385640480d4131a7f9d91ba425c Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Fri, 11 Mar 2016 21:10:21 +1100 Subject: [PATCH 1/3] fixed bash dependency in preamble it still read `Bash 4.0+`, changed to `Bash 3.0+` --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 08930e26..1ff3eead 100755 --- a/neofetch +++ b/neofetch @@ -5,7 +5,7 @@ # https://github.com/dylanaraps/neofetch # # Required Dependencies: -# Bash 4.0+ +# Bash 3.0+ # xprop # [Linux / BSD / Windows] Uptime detection: procps or procps-ng # From 641470ccd7746c18cc4f9355ef61674357029742 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 12 Mar 2016 10:17:26 +1100 Subject: [PATCH 2/3] added working birthday function for OS X --- neofetch | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 1ff3eead..2799627c 100755 --- a/neofetch +++ b/neofetch @@ -1564,8 +1564,23 @@ getbirthday () { ;; "Mac OS X") - birthday="$(ls -alctT /var/log/CDIS.custom | awk '{printf $6 " " $7 " " $9 " " $8}')" - date_cmd="$(date -j -f "%b %d %Y" "$birthday" +"$birthday_format")" + birthday="$(ls -lUT /var/log/install.log | awk '{printf $6 " " $7 " " $9 " " $8}')" + + # Split the string into Date + time + time=${birthday/*???? } + birthday=${birthday/$time} + + case "${time/:*}" in + 0? | 10 | 11) + time+=" AM" + ;; + + *) + time+=" PM" + ;; + esac + birthday+="$time" + birthday_shorthand="on" ;; *"BSD") @@ -1603,7 +1618,7 @@ getbirthday () { esac # Strip seconds from time output - birthday=${birthday%:*} + birthday=${birthday/:?? /} # Pretty output [ "$birthday_shorthand" == "off" ] && \ From 74f5f765697319b4dd6ecb46543184a39d5c1157 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 12 Mar 2016 10:25:19 +1100 Subject: [PATCH 3/3] fixed spacing between time and AM/PM --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 2799627c..da9a6fc9 100755 --- a/neofetch +++ b/neofetch @@ -1572,11 +1572,11 @@ getbirthday () { case "${time/:*}" in 0? | 10 | 11) - time+=" AM" + time+=" AM" ;; *) - time+=" PM" + time+=" PM" ;; esac birthday+="$time" @@ -1618,7 +1618,7 @@ getbirthday () { esac # Strip seconds from time output - birthday=${birthday/:?? /} + birthday=${birthday/:?? / } # Pretty output [ "$birthday_shorthand" == "off" ] && \