Redesign the WM mode modeline
This commit is contained in:
parent
38986f37da
commit
ec84355202
16
flake.nix
16
flake.nix
|
@ -59,7 +59,21 @@
|
||||||
nativeBuildInputs = [ default.fg42 pkgs.fish test-x default.run-test-wm ];
|
nativeBuildInputs = [ default.fg42 pkgs.fish test-x default.run-test-wm ];
|
||||||
buildInputs = [ default.fg42 ];
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,8 @@
|
||||||
forge
|
forge
|
||||||
svg-tag-mode
|
svg-tag-mode
|
||||||
base16-theme
|
base16-theme
|
||||||
consult)
|
consult
|
||||||
|
nerd-icons-completion)
|
||||||
|
|
||||||
(provide 'fg42/deps)
|
(provide 'fg42/deps)
|
||||||
;;; deps.el ends here
|
;;; deps.el ends here
|
||||||
|
|
|
@ -196,5 +196,14 @@ match all of the components in any order."
|
||||||
:bind (("M-g e" . consult-compile-error)))
|
: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)
|
(provide 'fg42/minibuffer)
|
||||||
;;; minibuffer.el ends here
|
;;; minibuffer.el ends here
|
||||||
|
|
|
@ -58,6 +58,7 @@ to Emacs modeline."
|
||||||
:commands noether-global-mode
|
:commands noether-global-mode
|
||||||
:config
|
:config
|
||||||
(require 'noether-views)
|
(require 'noether-views)
|
||||||
|
(require 'fg42/modeline/views)
|
||||||
|
|
||||||
(let ((active-border (get-base16-color-or :base0A "#bd93f9"))
|
(let ((active-border (get-base16-color-or :base0A "#bd93f9"))
|
||||||
(inactive-border (get-base16-color-or :base03 "#44475a")))
|
(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)
|
(if fg42/modeline-inactive-face fg42/modeline-inactive-face 'fg42/-disabled-modeline-dective-border)
|
||||||
(default-value 'face-remapping-alist) face-remaps))
|
(default-value 'face-remapping-alist) face-remaps))
|
||||||
|
|
||||||
|
;; Setup modelines
|
||||||
(when-not-wm
|
(when-not-wm
|
||||||
(require 'fg42/modeline/views)
|
(setq-default noether-views (list fg42/modeline)))
|
||||||
|
|
||||||
(when-not-wm
|
|
||||||
(setq-default noether-views (list fg42/modeline))))
|
|
||||||
|
|
||||||
(when-wm
|
(when-wm
|
||||||
(setq-default noether-views (list fg42/minimal-exwm))))
|
(setq-default noether-views (list fg42/minimal-exwm))))
|
||||||
|
|
|
@ -64,9 +64,12 @@
|
||||||
"Set the EXWM input mode for the current buffer."
|
"Set the EXWM input mode for the current buffer."
|
||||||
(setq fg42/-exwm-input-mode (format "%s" exwm--input-mode)))
|
(setq fg42/-exwm-input-mode (format "%s" exwm--input-mode)))
|
||||||
|
|
||||||
|
|
||||||
(defun fg42/-format-exwm-input-mode (_ v _ _)
|
(defun fg42/-format-exwm-input-mode (_ v _ _)
|
||||||
"Just return the input mode name 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
|
(noether-defunit fg42/exwm-input-mode-unit
|
||||||
|
|
|
@ -31,6 +31,11 @@
|
||||||
"Keep the modeline at bottom right by using the data from INFO."
|
"Keep the modeline at bottom right by using the data from INFO."
|
||||||
(cons -1 -1))
|
(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)
|
(defun fg42/adjust-modeline (view)
|
||||||
"Adjust the VIEW after parent frame resize."
|
"Adjust the VIEW after parent frame resize."
|
||||||
|
@ -69,28 +74,29 @@
|
||||||
(line-unit :label (format "%s " (nerd-icons-codicon "nf-cod-location")))))
|
(line-unit :label (format "%s " (nerd-icons-codicon "nf-cod-location")))))
|
||||||
|
|
||||||
|
|
||||||
(when-wm
|
(noether-defview fg42/minimal-exwm
|
||||||
(noether-defview fg42/minimal-exwm
|
"A super simple bar containing the line number and column number that
|
||||||
"A super simple bar containing the line number and column number that
|
|
||||||
Appears on the center of the current window."
|
Appears on the center of the current window."
|
||||||
:managed? t
|
:managed? t
|
||||||
:buffer "*exwm-status*"
|
:buffer "*exwm-status*"
|
||||||
:binding (kbd "C-c 3")
|
:binding (kbd "C-c 3")
|
||||||
:separator "|"
|
:separator " | "
|
||||||
:frame
|
:visible? t
|
||||||
(list
|
:timeout 0
|
||||||
;; Such a big numbers for X and Y will cause the frame to appear on the
|
:frame
|
||||||
;; bottom right corner and covering the minibuffer
|
(list
|
||||||
:position '(-30 . -1)
|
:poshandler #'fg42/--bottom-right-padded
|
||||||
:border-width 0
|
:border-width 1
|
||||||
:timeout 5
|
:border-color "#bd93f9")
|
||||||
:border-color "#bd93f9")
|
|
||||||
|
|
||||||
:units
|
:units
|
||||||
(list
|
(list
|
||||||
(fg42/exwm-input-mode-unit :label "")
|
(fg42/exwm-input-mode-unit :label (format "%s " (nerd-icons-faicon "nf-fa-linux")))
|
||||||
(buffer-name-unit :label "")
|
(buffer-name-unit
|
||||||
(time-unit :label ""))))
|
: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)
|
(provide 'fg42/modeline/views)
|
||||||
|
|
Loading…
Reference in New Issue