mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
Show dashboard in emacsclient frames
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
;;; dashboard.el --- Startup dashboard -*- lexical-binding: t; -*-
|
;;; dashboard.el --- Startup dashboard -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Show the dashboard on regular startup and on empty emacsclient frames.
|
||||||
|
|
||||||
(use-package dashboard
|
(use-package dashboard
|
||||||
:ensure t
|
:ensure t
|
||||||
:init
|
:init
|
||||||
@@ -12,6 +16,18 @@
|
|||||||
:config
|
:config
|
||||||
(dashboard-setup-startup-hook))
|
(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)
|
(provide 'dashboard)
|
||||||
|
|
||||||
;;; misc-dashboard.el ends here
|
;;; misc-dashboard.el ends here
|
||||||
|
|||||||
Reference in New Issue
Block a user