Fix birthday output on OS X

This commit is contained in:
Dylan 2016-01-30 23:34:53 +11:00
parent 5877a13742
commit 1149b3d6a6

12
fetch
View file

@ -57,7 +57,7 @@ printinfo () {
# info "Disk" disk # info "Disk" disk
# info "Resolution" resolution # info "Resolution" resolution
# info "Song" song # info "Song" song
# info "Birthday" birthday info "Birthday" birthday
# info "Visual Style" visualstyle # info "Visual Style" visualstyle
info linebreak info linebreak
@ -1190,12 +1190,14 @@ getdisk () {
getbirthday () { getbirthday () {
case "$os" in case "$os" in
"Linux" | *"BSD") "Linux")
birthday="$(ls -alct --full-time / | awk '/lost\+found/ {printf $6 " " $7}')" birthday="$(ls -alct --full-time / | awk '/lost\+found/ {printf $6 " " $7}')"
date_cmd="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")"
;; ;;
"Mac OS X") "Mac OS X" | *"BSD")
birthday="$(ls -alctT /var/log/CDIS.custom | tail -1 | awk '{printf $6 " " $7 " " $9 " " $8}')" birthday="$(ls -alctT /var/log/CDIS.custom | tail -1 | awk '{printf $6 " " $7 " " $9 " " $8}')"
date_cmd="$(date -j -f "%b %d %Y" "$birthday" "+%a %d %b %Y %l:%M %p")"
;; ;;
*) *)
@ -1209,8 +1211,8 @@ getbirthday () {
# Pretty output # Pretty output
if [ "$birthday_shorthand" == "off" ]; then if [ "$birthday_shorthand" == "off" ]; then
birthday="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")" birthday="$date_cmd"
birthday=${birthday/ } birthday=${birthday/ / }
fi fi
# Toggle showing the time # Toggle showing the time