From 5d02a9c26a22b97966f98c00db4d090c7391f48d Mon Sep 17 00:00:00 2001 From: Artur Manuel Date: Tue, 15 Apr 2025 05:47:12 +0100 Subject: [PATCH] doom-modeline: refresh bar on frame-creation Thanking phil.catalyst from #emacs for suggesting this fix! This should make it so modules on the right-hand side of the modeline doesn't cut itself off. Usually, an Emacs server started won't have a GUI, so doom-modeline doesn't actually know its width. Refreshing doom-modeline when a new frame is created will make it aware of its width from (re)initialisation. --- config/config-ui.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/config-ui.el b/config/config-ui.el index b47881a..dacdc21 100644 --- a/config/config-ui.el +++ b/config/config-ui.el @@ -2,12 +2,19 @@ (defun config-init-ui () + (defun my/doom-modeline-for-new-frames (&optional frame) + (setq doom-modeline-height (+ (frame-char-height) 8)) + (with-selected-frame (or frame (selected-frame)) + (doom-modeline-refresh-bars))) + (use-package doom-modeline :defer t :commands (doom-modeline-mode) :custom (doom-modeline-mode t) - (doom-modeline-env-load-string "")) + (doom-modeline-env-load-string "") + (doom-modeline-height (+ (frame-char-height) 8)) + :hook (after-make-frame-functions . my/doom-modeline-for-new-frames)) (use-package base16-theme :config