X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=autoconfig.functions;h=b7d694c0fe4b0c35238c62c0245059eec5fd8756;hb=60157801aae38ff3348715f7a68d0e5ba6bfc2ba;hp=0da044d51955f548148af419b6e7ec2eb629037b;hpb=1a7c49a326167efa857546f37b551ea3924f5654;p=grml-autoconfig.git diff --git a/autoconfig.functions b/autoconfig.functions index 0da044d..b7d694c 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1992,5 +1992,32 @@ fi } # }}} +# {{{ Easteregg (for 20 years grml.org) +config_easteregg() { + current_date=$(date +%Y-%m-%d) + birthday="2023-09-16" + one_month_later=$(date -d "${current_date} + 1 month" +%Y-%m-%d) + + einfo "You found the birthday easter egg!" ; eend 0 + + # nothing to be done if it's more than one month since $birthday + if ! [[ "${current_date}" == "${birthday}" || "${current_date}" == "${one_month_later}" ]]; then + return 0 + fi + + if [[ -x /bin/toilet && -x /usr/games/lolcat ]] ; then + visualize() { printf "%s\n" "$*" | toilet | /usr/games/lolcat ; } + elif [[ -x /bin/toilet ]] ; then + visualize() { printf "%s\n" "$*" | toilet ; } + else + visualize() { printf "%s\n" "$*" ; } + fi + + visualize " \o/ " + visualize "20 years" + visualize "grml.org" +} +# }}} + ## END OF FILE ################################################################# # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=2