Skip to content

Commit

Permalink
refactor(daemon): move generic daemon tweaks to me-builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 8, 2023
1 parent 96d6936 commit c38c671
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 12 additions & 0 deletions core/me-builtin.el
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,18 @@ current line.")
(window-divider-default-bottom-width 2)
(window-divider-default-right-width 2))

(use-package server
:straight (:type built-in)
:hook (server-after-make-frame . +load-theme) ; Reload theme when creating a frame on the daemon
:autoload server-running-p
:init
;; When we start in a non-daemon Emacs, we start a server whe Emacs is idle.
(+lazy-unless! (daemonp)
(unless (server-running-p)
(let ((inhibit-message t))
(server-start nil t)
(+info! "Started Emacs daemon in background.")))))

(use-package speedbar ; config from Crafted Emacs
:straight (:type built-in)
:custom
Expand Down
11 changes: 0 additions & 11 deletions modules/me-daemon.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@
(let ((inhibit-message t))
(elfeed-update))))))

;; When we start in a non-daemon Emacs, we start a server whe Emacs is idle.
(+lazy-unless! (daemonp)
(require 'server) ; For using `server-running-p'
(unless (server-running-p)
(let ((inhibit-message t))
(+info! "Starting Emacs daemon in background.")
(server-start nil t))))

;; Reload theme when creating a frame on the daemon
(add-hook 'server-after-make-frame-hook #'+load-theme)


(provide 'me-daemon)

Expand Down

0 comments on commit c38c671

Please sign in to comment.