Show dashboard in emacsclient frames

This commit is contained in:
Fabio Scotto di Santolo
2026-04-12 15:12:19 +02:00
parent d4b7a40568
commit 1d3eee3372

View File

@@ -1,5 +1,9 @@
;;; dashboard.el --- Startup dashboard -*- lexical-binding: t; -*-
;;; Commentary:
;; Show the dashboard on regular startup and on empty emacsclient frames.
(use-package dashboard
:ensure t
:init
@@ -12,6 +16,18 @@
:config
(dashboard-setup-startup-hook))
(defun fscotto/show-dashboard-on-client-frame ()
"Show dashboard in an empty graphical emacsclient frame."
(when (and (display-graphic-p)
(string= (buffer-name (window-buffer (selected-window))) "*scratch*"))
(require 'dashboard)
(switch-to-buffer dashboard-buffer-name)
(dashboard-refresh-buffer)
(goto-char (point-min))))
(with-eval-after-load 'server
(add-hook 'server-after-make-frame-hook #'fscotto/show-dashboard-on-client-frame))
(provide 'dashboard)
;;; misc-dashboard.el ends here