From 1d3eee3372a64b477217c835e010ad0a7a73b511 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sun, 12 Apr 2026 15:12:19 +0200 Subject: [PATCH] Show dashboard in emacsclient frames --- dotfiles/desktop/.emacs.d/lisp/misc/dashboard.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dotfiles/desktop/.emacs.d/lisp/misc/dashboard.el b/dotfiles/desktop/.emacs.d/lisp/misc/dashboard.el index 04cebf3..5ccd159 100644 --- a/dotfiles/desktop/.emacs.d/lisp/misc/dashboard.el +++ b/dotfiles/desktop/.emacs.d/lisp/misc/dashboard.el @@ -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