From 852ac93e2fa3ce63ab93a0eb3fa41c007454bb95 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 26 Jan 2021 23:20:48 -0600 Subject: Mess around with the modeline --- config.org | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/config.org b/config.org index 22de108..726d6cf 100644 --- a/config.org +++ b/config.org @@ -148,9 +148,12 @@ and have made a custom fringe bitmap. #b00000000]) #+end_src -*** Nyan mode +*** COMMENT Nyan mode -Fuck it, let's have some fun. ++Fuck it, let's have some fun.+ COMMENTED out because it messes up my +modeline :( + +This obviously needs a lot more research. #+begin_src emacs-lisp :noweb-ref packages (straight-use-package 'nyan-mode) @@ -162,6 +165,12 @@ I add it to the modeline [[*Simple modeline][below]]. (setq-default nyan-bar-length 20) #+end_src +But I still have to enable the mode ?! + +#+begin_src emacs-lisp :noweb-ref settings + (nyan-mode +1) +#+end_src + ** Windows *** Splitting windows sensibly @@ -505,11 +514,12 @@ landed on a good one: =simple-modeline=. #+begin_src emacs-lisp :noweb-ref settings (setq-default simple-modeline-segments - '((simple-modeline-segment-modified + '(;; left side + (simple-modeline-segment-modified simple-modeline-segment-buffer-name simple-modeline-segment-position) - (nyan-create - simple-modeline-segment-minor-modes + ;; right side + (simple-modeline-segment-minor-modes simple-modeline-segment-input-method simple-modeline-segment-vc simple-modeline-segment-misc-info @@ -521,6 +531,36 @@ landed on a good one: =simple-modeline=. (simple-modeline-mode +1) #+end_src +***** COMMENT Functions to figure out what window is focused + +How is this not built into Emacs? Oh well, I have [[https://github.com/jamesnvc/dotfiles/blob/master/emacs.d/modules/cogent-modeline.el][Cogent]] to thank. + +#+begin_src emacs-lisp :noweb-ref variables + (defvar cogent-line-selected-window (frame-selected-window)) +#+end_src + +#+begin_src emacs-lisp :noweb-ref functions + (defun cogent-line-set-selected-window (&rest _args) + (when (not (minibuffer-window-active-p (frame-selected-window))) + (setq cogent-line-selected-window (frame-selected-window)) + (force-mode-line-update))) + + (defun cogent-line-unset-selected-window () + (setq cogent-line-selected-window nil) + (force-mode-line-update)) + + (defun cogent-line-selected-window-active-p () + (eq cogent-line-selected-window (selected-window))) +#+end_src + +#+begin_src emacs-lisp :noweb-ref hooks + (add-hook 'window-configuration-change-hook #'cogent-line-set-selected-window) + (add-hook 'focus-in-hook #'cogent-line-set-selected-window) + (add-hook 'focus-out-hook #'cogent-line-unset-selected-window) + (advice-add 'handle-switch-frame :after #'cogent-line-set-selected-window) + (advice-add 'select-window :after #'cogent-line-set-selected-window) +#+end_src + **** Blackout some modes :package: Like =diminish= or =delight=, =blackout= allows me to remove some -- cgit 1.4.1-21-gabe81