From dac7f5768fa49b9a6bda4780dbaf7b704fea455f Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 30 Jan 2016 23:51:12 +1100 Subject: [PATCH] Add windows support to getbirthday --- fetch | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fetch b/fetch index 695fa339..cd6c53cb 100755 --- a/fetch +++ b/fetch @@ -1195,11 +1195,18 @@ getbirthday () { date_cmd="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")" ;; - "Mac OS X" | *"BSD") + "Mac OS X") 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")" ;; + "Windows") + birhday="$(cmd /K WMIC OS GET InstallDate)" + birthday=${birthday/InstallDate } + birthday=${birthday//[[:space:]]/ } + date_cmd="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")" + ;; + *) birthday="Unknown" ;;