Redesign the WM mode modeline

This commit is contained in:
Sameer Rahmani 2024-04-11 22:14:25 +01:00
parent 38986f37da
commit ec84355202
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
6 changed files with 59 additions and 27 deletions

View File

@ -59,7 +59,21 @@
nativeBuildInputs = [ default.fg42 pkgs.fish test-x default.run-test-wm ];
buildInputs = [ default.fg42 ];
};
};
apps.wm = {
type = "app";
program = "${default.run-test-wm}/bin/run-test-wm";
};
apps.x = {
type = "app";
program = "${test-x}/bin/test-x";
};
apps.default = {
type = "app";
program = "${default.fg42}/bin/fg42";
};
};
};
}

View File

@ -122,7 +122,8 @@
forge
svg-tag-mode
base16-theme
consult)
consult
nerd-icons-completion)
(provide 'fg42/deps)
;;; deps.el ends here

View File

@ -196,5 +196,14 @@ match all of the components in any order."
:bind (("M-g e" . consult-compile-error)))
(use! nerd-icons-completion
"Nerd icons in marginalia"
:after marginalia
:config
(nerd-icons-completion-mode)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))
(provide 'fg42/minibuffer)
;;; minibuffer.el ends here

View File

@ -58,6 +58,7 @@ to Emacs modeline."
:commands noether-global-mode
:config
(require 'noether-views)
(require 'fg42/modeline/views)
(let ((active-border (get-base16-color-or :base0A "#bd93f9"))
(inactive-border (get-base16-color-or :base03 "#44475a")))
@ -73,11 +74,9 @@ to Emacs modeline."
(if fg42/modeline-inactive-face fg42/modeline-inactive-face 'fg42/-disabled-modeline-dective-border)
(default-value 'face-remapping-alist) face-remaps))
;; Setup modelines
(when-not-wm
(require 'fg42/modeline/views)
(when-not-wm
(setq-default noether-views (list fg42/modeline))))
(setq-default noether-views (list fg42/modeline)))
(when-wm
(setq-default noether-views (list fg42/minimal-exwm))))

View File

@ -64,9 +64,12 @@
"Set the EXWM input mode for the current buffer."
(setq fg42/-exwm-input-mode (format "%s" exwm--input-mode)))
(defun fg42/-format-exwm-input-mode (_ v _ _)
"Just return the input mode name V."
v)
(if (=string v "line")
(propertize "L" 'font-lock-face `(:foreground ,(get-base16-color-or :base07 "eeeeec")))
(propertize "C" 'font-lock-face `(:foreground ,(get-base16-color-or :base0A "eeeeec")))))
(noether-defunit fg42/exwm-input-mode-unit

View File

@ -31,6 +31,11 @@
"Keep the modeline at bottom right by using the data from INFO."
(cons -1 -1))
(defun fg42/--bottom-right-padded (info)
"Keep the modeline at bottom right by using the data from INFO."
(message "here")
(cons 20 20))
(defun fg42/adjust-modeline (view)
"Adjust the VIEW after parent frame resize."
@ -69,28 +74,29 @@
(line-unit :label (format "%s " (nerd-icons-codicon "nf-cod-location")))))
(when-wm
(noether-defview fg42/minimal-exwm
"A super simple bar containing the line number and column number that
(noether-defview fg42/minimal-exwm
"A super simple bar containing the line number and column number that
Appears on the center of the current window."
:managed? t
:buffer "*exwm-status*"
:binding (kbd "C-c 3")
:separator "|"
:frame
(list
;; Such a big numbers for X and Y will cause the frame to appear on the
;; bottom right corner and covering the minibuffer
:position '(-30 . -1)
:border-width 0
:timeout 5
:border-color "#bd93f9")
:managed? t
:buffer "*exwm-status*"
:binding (kbd "C-c 3")
:separator " | "
:visible? t
:timeout 0
:frame
(list
:poshandler #'fg42/--bottom-right-padded
:border-width 1
:border-color "#bd93f9")
:units
(list
(fg42/exwm-input-mode-unit :label "")
(buffer-name-unit :label "")
(time-unit :label ""))))
:units
(list
(fg42/exwm-input-mode-unit :label (format "%s " (nerd-icons-faicon "nf-fa-linux")))
(buffer-name-unit
:label (format "%s " (nerd-icons-codicon "nf-cod-layers"))
:len 30)
(time-unit :label (format "%s " (nerd-icons-mdicon "nf-md-clock_time_three")))))
(provide 'fg42/modeline/views)