diff --git a/README.md b/README.md index 2931a851..28fe9c8a 100644 --- a/README.md +++ b/README.md @@ -261,6 +261,7 @@ alias fetch2="fetch \ --song_shorthand on/off Print the Artist/Title on seperate lines --birthday_shorthand on/off Shorten the output of birthday --birthday_time on/off Enable/Disable showing the time in birthday output + --birthday_format format Format the birthday output. (Uses 'date' cmd format) Text Formatting: diff --git a/config/config b/config/config index 4f25786c..0f42e5d5 100644 --- a/config/config +++ b/config/config @@ -158,6 +158,11 @@ birthday_shorthand="off" # --birthday_time on/off birthday_time="on" +# Date format to use when printing birthday +# --birthday_format "format" +birthday_format="+%a %d %b %Y %l:%M %p" + + # Color Blocks # Color block range diff --git a/neofetch b/neofetch index 710363f1..ad91dbc1 100755 --- a/neofetch +++ b/neofetch @@ -178,6 +178,11 @@ birthday_shorthand="off" # --birthday_time on/off birthday_time="on" +# Date format to use when printing birthday +# --birthday_format "format" +birthday_format="%a %d %b %Y %l:%M %p" + + # Color Blocks # Color block range @@ -1513,12 +1518,12 @@ getbirthday () { case "$os" in "Linux") birthday="$(ls -alct --full-time / | awk '/lost\+found/ {printf $6 " " $7}')" - date_cmd="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")" + date_cmd="$(date -d"$birthday" +"$birthday_format")" ;; "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" "+%a %d %b %Y %l:%M %p")" + date_cmd="$(date -j -f "%b %d %Y" "$birthday" +"$birthday_format")" ;; *"BSD") @@ -1530,7 +1535,7 @@ getbirthday () { "FreeBSD"*) birthday="$(ls -alctT /etc/hostid | awk '{printf $6 " " $7 " " $9 " " $8}')" - date_cmd="$(date -j -f "%b %d %Y" "$birthday" "+%a %d %b %Y %l:%M %p")" + date_cmd="$(date -j -f "%b %d %Y" "$birthday" +"$birthday_format")" ;; "NetBSD"*) @@ -1546,7 +1551,7 @@ getbirthday () { "Windows") birthday="$(ls -alct --full-time /cygdrive/c/Windows/explorer.exe | awk '{printf $8 " " $9}')" - date_cmd="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")" + date_cmd="$(date -d"$birthday" +"$birthday_format")" ;; *) @@ -2302,6 +2307,7 @@ usage () { cat << EOF --song_shorthand on/off Print the Artist/Title on seperate lines --birthday_shorthand on/off Shorten the output of birthday --birthday_time on/off Enable/Disable showing the time in birthday output + --birthday_format format Format the birthday output. (Uses 'date' cmd format) Text Formatting: @@ -2400,6 +2406,7 @@ while [ "$1" ]; do --song_shorthand) song_shorthand="$2" ;; --birthday_shorthand) birthday_shorthand="$2" ;; --birthday_time) birthday_time="$2" ;; + --birthday_format) birthday_format="$2" ;; --disable) for func in "$@"; do case "$func" in diff --git a/neofetch.1 b/neofetch.1 index 6be97b8b..f623f32c 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -74,6 +74,9 @@ Shorten the output of birthday .TP .B \--birthday_time 'on/off' Enable/Disable showing the time in birthday output +.TP +.B \--birthday_format 'format' +Format the birthday output. (Uses 'date' cmd format) .SH TEXT FORMATTING .TP