From 2490a45293890efd05f36228d8c2d8de33d7da97 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 16 Dec 2016 18:03:29 +1100 Subject: [PATCH] Birthday: Rename get_birthday() to get_install_date() --- config/config | 8 ++++---- config/travis | 2 +- neofetch | 38 ++++++++++++++++++++------------------ neofetch.1 | 4 ++-- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/config/config b/config/config index c3d2da18..f89a2d9b 100644 --- a/config/config +++ b/config/config @@ -39,7 +39,7 @@ print_info() { # info "Local IP" local_ip # info "Public IP" public_ip # info "Users" users - # info "Birthday" birthday + # info "Install Date" install_date info line_break info cols @@ -292,19 +292,19 @@ public_ip_host="http://ident.me" song_shorthand="off" -# Birthday +# Install Date # Whether to show the time in the output # # Default: 'on' # Values: 'on', 'off' -# Flag: --birthday_time +# Flag: --install_time # # Example: # on: 'Thu 14 Apr 2016 11:50 PM' # off: 'Thu 14 Apr 2016' -birthday_time="on" +install_time="on" # Text Colors diff --git a/config/travis b/config/travis index 583ae1cd..42431a17 100644 --- a/config/travis +++ b/config/travis @@ -33,7 +33,7 @@ print_info() { info "Local IP" local_ip info "Public IP" public_ip info "Users" users - info "Birthday" birthday + info "Install Date" install_date info line_break info cols diff --git a/neofetch b/neofetch index 12d22239..bfac8b94 100755 --- a/neofetch +++ b/neofetch @@ -1726,51 +1726,51 @@ get_users() { users="${users%\,*}" } -get_birthday() { +get_install_date() { case "$os" in "Linux" | "GNU" | "iPhone OS") - birthday="$(ls -alct --full-time / | awk '/lost\+found|private/ {printf $6 " " $7}')" + install_date="$(ls -alct --full-time / | awk '/lost\+found|private/ {printf $6 " " $7}')" ;; "Mac OS X") - birthday="$(ls -lUT /var/log/install.log | awk '{printf $9 " " $6 " " $7 " " $8}')" + install_date="$(ls -lUT /var/log/install.log | awk '{printf $9 " " $6 " " $7 " " $8}')" ;; "BSD") case "$kernel_name" in "OpenBSD"* | "Bitrig"*) - birthday_file="/" + install_file="/" ;; "FreeBSD"*) - birthday_file="/etc/hostid" + install_file="/etc/hostid" ;; "NetBSD"* | "DragonFly"*) - birthday_file="/etc/defaults/rc.conf" + install_file="/etc/defaults/rc.conf" ;; esac - birthday="$(ls -alctT "$birthday_file" | awk '{printf $9 " " $6 " " $7 " " $8 " "}')" + install_date="$(ls -alctT "$install_file" | awk '{printf $9 " " $6 " " $7 " " $8 " "}')" ;; "Windows") - birthday="$(ls -alct --full-time /cygdrive/c/Windows/explorer.exe | awk '{printf $8 " " $9}')" + install_date="$(ls -alct --full-time /cygdrive/c/Windows/explorer.exe | awk '{printf $8 " " $9}')" ;; "Solaris") - birthday="$(ls -alct --full-time /var/sadm/system/logs/install_log | awk '{printf $6 " " $7}')" + install_date="$(ls -alct --full-time /var/sadm/system/logs/install_log | awk '{printf $6 " " $7}')" ;; "Haiku") - birthday="$(ls -alctd --full-time /boot | awk '{printf $6 " " $7}')" + install_date="$(ls -alctd --full-time /boot | awk '{printf $6 " " $7}')" ;; esac - birthday="${birthday//-/ }" - birthday="${birthday%:*}" - birthday=($birthday) - birthday="$(convert_time "${birthday[@]}")" + install_date="${install_date//-/ }" + install_date="${install_date%:*}" + install_date=($install_date) + install_date="$(convert_time "${install_date[@]}")" } get_cols() { @@ -2883,6 +2883,8 @@ old_functions() { get_publicip() { get_public_ip; publicip="$public_ip"; } get_linebreak() { get_line_break; linebreak="$line_break"; } fi + + get_birthday() { get_install_date; birthday="$install_date"; } } old_options() { @@ -2970,9 +2972,9 @@ convert_time() { esac # Toggle showing the time - [[ "$birthday_time" == "off" ]] && unset time + [[ "$install_time" == "off" ]] && unset time - # Print the birthday. + # Print the install date. printf "%s" "$week_day $day $month $year $time" } @@ -3034,7 +3036,7 @@ INFO --shell_version on/off Enable/Disable showing \$SHELL version --ip_host url URL to query for public IP --song_shorthand on/off Print the Artist/Title on seperate lines - --birthday_time on/off Enable/Disable showing the time in birthday output. + --install_time on/off Enable/Disable showing the time in Install Date output. TEXT FORMATTING @@ -3203,7 +3205,7 @@ get_args() { "--shell_version") shell_version="$2" ;; "--ip_host") public_ip_host="$2" ;; "--song_shorthand") song_shorthand="$2" ;; - "--birthday_time") birthday_time="$2" ;; + "--install_time") install_time="$2" ;; "--disable") for func in "$@"; do case "$func" in diff --git a/neofetch.1 b/neofetch.1 index 6484a727..bf513aef 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -89,8 +89,8 @@ URL to query for public IP \fB\-\-song_shorthand\fR on/off Print the Artist/Title on seperate lines .TP -\fB\-\-birthday_time\fR on/off -Enable/Disable showing the time in birthday output. +\fB\-\-install_time\fR on/off +Enable/Disable showing the time in Install Date output. .PP TEXT FORMATTING .TP