Created
September 21, 2020 08:48
-
-
Save arocks/cfae962a38ceab2f3c44f01660913cc7 to your computer and use it in GitHub Desktop.
Emacs greeting appearing in the *scratch* buffer that changes based on the time of the day and day of the week.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Initial scratch buffer greeting | |
(defun arun/greet-by-hour () | |
"Greet morning/evening/afternoon based on time of the day" | |
(let ((hour (string-to-number (format-time-string "%H")))) | |
(cond ((< hour 12) "morning") | |
((< hour 18) "afternoon") | |
(t "evening")))) | |
(setq user-full-name "Arun Ravindran") | |
(setq-default initial-scratch-message | |
(concat ";; Happy hacking " "on a " (format-time-string "%A") " " (arun/greet-by-hour) ", " user-full-name " - Emacs ♥ you!\n\n")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment