summaryrefslogtreecommitdiff
path: root/dashboard.el
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard.el')
-rw-r--r--dashboard.el59
1 files changed, 42 insertions, 17 deletions
diff --git a/dashboard.el b/dashboard.el
index 0a4402e..c608b34 100644
--- a/dashboard.el
+++ b/dashboard.el
@@ -5,31 +5,55 @@
"The name of the buffer for the dashboard.")
;;;###autoload
+(defvar dashboard-cat-text
+ (list
+ " "
+ " /\\ "
+ " / \\ "
+ " / =\\= "
+ " / - \\=----- "
+ " / |.| / "
+ " \\\\ - - / "
+ " \\\\ |.| | "
+ " / \\\\ - / "
+ " / \\\\ / "
+ " ||==========| ========\\=| "
+ " ||==========| -- | "
+ " | || /==== | "
+ " == | / \\ \\ "
+ " | | \\ \\ "
+ " ==== ==== ")
+ "A clumsy text representation of a cute cat.")
+
+;;;###autoload
(defun dashboard ()
"Create the dashboard buffer."
(interactive)
(let ((dashboard-exists-p (get-buffer dashboard-buffer-name))
(dashboard (get-buffer-create dashboard-buffer-name)))
(cond
- (dashboard-exists-p
- (switch-to-buffer dashboard))
+ (dashboard-exists-p (switch-to-buffer dashboard))
(t
(with-current-buffer dashboard
- (let ((image (create-image "~/.doom.d/banners/default.png")))
- (insert
- (make-string 3 10)
- (center-string-in-width
- (propertize " " 'display image 'rear-nonsticky '(display))
- (round (- (window-body-width)
- (* (car (image-size image)) 0.7))))))
+ (cond
+ ((display-graphic-p)
+ (let ((image (create-image "~/.doom.d/banners/default.png")))
+ (insert
+ (make-string 3 10)
+ (center-string-in-width
+ (propertize " " 'display image 'rear-nonsticky '(display))
+ (round (- (window-body-width)
+ (* (car (image-size image)) 0.7)))))))
+ ((mapc (function
+ (lambda (str)
+ (insert
+ (center-string-in-width str (- (window-body-width) 13))
+ "\n")))
+ dashboard-cat-text)))
(newline 5)
- (insert
- (center-string-in-width
- "Dashboard"
- (window-body-width)))
+ (insert (center-string-in-width "Dashboard" (window-body-width)))
(read-only-mode 1)
- (set 'mode-line-format
- '("%e" (:eval (modeline-format-dashboard))))
+ (set 'mode-line-format '("%e" (:eval (modeline-format-dashboard))))
(view-mode 1))))
dashboard))
@@ -42,8 +66,9 @@
"Don't kill the dashboard buffer."
(cond
((eq (current-buffer) (get-buffer dashboard-buffer-name))
- (message "Don't kill the dashboard buffer.")
- nil)
+ ;; The function message returns the message, so applying not will
+ ;; produce nil as needed.
+ (not (message "Don't kill the dashboard buffer.")))
(t)))
(add-hook 'kill-buffer-query-functions 'dont-kill-dashboard-fn)