Merge pull request #136 from iandrewt/osx_birthday
Added working birthday function for OS X
This commit is contained in:
commit
b80f1b335a
1 changed files with 19 additions and 4 deletions
23
neofetch
23
neofetch
|
@ -5,7 +5,7 @@
|
||||||
# https://github.com/dylanaraps/neofetch
|
# https://github.com/dylanaraps/neofetch
|
||||||
#
|
#
|
||||||
# Required Dependencies:
|
# Required Dependencies:
|
||||||
# Bash 4.0+
|
# Bash 3.0+
|
||||||
# xprop
|
# xprop
|
||||||
# [Linux / BSD / Windows] Uptime detection: procps or procps-ng
|
# [Linux / BSD / Windows] Uptime detection: procps or procps-ng
|
||||||
#
|
#
|
||||||
|
@ -1564,8 +1564,23 @@ getbirthday () {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
birthday="$(ls -alctT /var/log/CDIS.custom | awk '{printf $6 " " $7 " " $9 " " $8}')"
|
birthday="$(ls -lUT /var/log/install.log | awk '{printf $6 " " $7 " " $9 " " $8}')"
|
||||||
date_cmd="$(date -j -f "%b %d %Y" "$birthday" +"$birthday_format")"
|
|
||||||
|
# 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")
|
*"BSD")
|
||||||
|
@ -1603,7 +1618,7 @@ getbirthday () {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Strip seconds from time output
|
# Strip seconds from time output
|
||||||
birthday=${birthday%:*}
|
birthday=${birthday/:?? / }
|
||||||
|
|
||||||
# Pretty output
|
# Pretty output
|
||||||
[ "$birthday_shorthand" == "off" ] && \
|
[ "$birthday_shorthand" == "off" ] && \
|
||||||
|
|
Loading…
Reference in a new issue