2021-05-02 22:47:01 +01:00
|
|
|
;;; ModelineCubes --- The modeline related cubes for FG42 -*- lexical-binding: t; -*-
|
|
|
|
;;
|
2022-07-01 18:27:21 +01:00
|
|
|
;; Copyright (c) 2010-2022 Sameer Rahmani & Contributors
|
2021-05-02 22:47:01 +01:00
|
|
|
;;
|
|
|
|
;; Author: Sameer Rahmani <lxsameer@gnu.org>
|
2022-12-19 21:07:48 +00:00
|
|
|
;; URL: https://devheroes.codes/FG42/FG42
|
2021-05-02 22:47:01 +01:00
|
|
|
;; Version: 3.0.0
|
|
|
|
;;
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
;;
|
|
|
|
;;; Commentary:
|
|
|
|
;;; Code:
|
|
|
|
(require 'fpkg)
|
|
|
|
(require 'fg42/cube)
|
2021-12-12 19:51:09 +00:00
|
|
|
(require 'cubes/icons)
|
|
|
|
|
|
|
|
(autoload-cube 'fg42/statusbar-default
|
|
|
|
"modeline/statusbar-default.el"
|
|
|
|
"The default StatusBar modeline.")
|
2021-05-02 22:47:01 +01:00
|
|
|
|
2021-12-12 11:15:23 +00:00
|
|
|
|
2021-05-03 01:42:57 +01:00
|
|
|
;; TODO: Break this into two cubes
|
2021-05-02 22:47:01 +01:00
|
|
|
(defcube fg42/modeline-cube
|
2021-10-12 00:35:05 +01:00
|
|
|
"Modeline cube"
|
2021-12-12 11:15:23 +00:00
|
|
|
(:title "Mini modeline"
|
|
|
|
:flag mini-mode-line
|
|
|
|
:group modeline
|
|
|
|
:flag-default t)
|
2021-05-02 22:47:01 +01:00
|
|
|
|
2021-12-11 14:56:57 +00:00
|
|
|
(defun fg42/mini-modeline-setter (def)
|
2021-12-14 19:52:35 +00:00
|
|
|
(if (null def)
|
|
|
|
(let ((def-list (funcall def)))
|
|
|
|
(setq-default mini-modeline-l-format (plist-get def-list :long))
|
|
|
|
(setq-default mini-modeline-r-format (plist-get def-list :brief)))
|
2021-12-12 19:51:09 +00:00
|
|
|
|
2021-12-14 19:52:35 +00:00
|
|
|
(setq-default
|
|
|
|
mini-modeline-r-format
|
|
|
|
'("%e"
|
|
|
|
mode-line-front-space
|
|
|
|
mode-line-mule-info
|
|
|
|
mode-line-client
|
|
|
|
mode-line-modified
|
|
|
|
mode-line-remote
|
|
|
|
mode-line-frame-identification
|
|
|
|
mode-line-buffer-identification
|
|
|
|
mode-line-position
|
|
|
|
evil-mode-line-tag
|
|
|
|
(:eval (string-trim (format-mode-line mode-line-modes)))
|
|
|
|
mode-line-misc-info ))))
|
2021-12-11 14:56:57 +00:00
|
|
|
|
2021-05-02 22:47:01 +01:00
|
|
|
(fpkg/use smart-mode-line
|
|
|
|
:straight (smart-mode-line :source melpa)
|
|
|
|
:defer nil
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq sml/theme 'respectful)
|
|
|
|
(setq sml/no-confirm-load-theme t)
|
|
|
|
(sml/setup)))
|
|
|
|
|
|
|
|
(fpkg/use mini-modeline
|
|
|
|
:straight (mini-modeline :repo "kiennq/emacs-mini-modeline"
|
|
|
|
:host github
|
|
|
|
:type git)
|
|
|
|
:after smart-mode-line
|
|
|
|
:init
|
2021-12-11 14:56:57 +00:00
|
|
|
(progn
|
2021-12-12 11:15:23 +00:00
|
|
|
(setq mini-modeline-enhance-visual nil)
|
2021-12-11 14:56:57 +00:00
|
|
|
(setq fg42/modeline-setter #'fg42/mini-modeline-setter))
|
2021-05-02 22:47:01 +01:00
|
|
|
:defer nil
|
|
|
|
:config
|
2023-06-10 20:47:55 +01:00
|
|
|
(add-hook 'fg42/after-init-hook #'mini-modeline-mode)
|
2023-05-31 23:37:58 +01:00
|
|
|
(add-hook 'fg42/after-initializing-theme-hook
|
|
|
|
(lambda ()
|
|
|
|
(custom-set-faces
|
|
|
|
'(mini-modeline-mode-line
|
|
|
|
((((background light))
|
|
|
|
:background "#aa0000" :height 0.1 :box nil)
|
|
|
|
(t
|
|
|
|
:background "#bd93f9" :height 0.1 :box nil))))))))
|
2021-12-12 11:15:23 +00:00
|
|
|
|
2021-12-12 19:51:09 +00:00
|
|
|
|
2021-12-12 11:15:23 +00:00
|
|
|
(defcube fg42/statusbar-cube
|
|
|
|
"Status bar replaces the default mode line aned merges with
|
|
|
|
the mini buffer to provide a minimal interface for displaying
|
|
|
|
valuable information."
|
|
|
|
(:title "Status bar cube"
|
|
|
|
:flag status-bar
|
|
|
|
:group modeline
|
2023-05-31 23:37:58 +01:00
|
|
|
:flag-default nil)
|
2021-12-12 11:15:23 +00:00
|
|
|
|
2021-12-12 19:51:09 +00:00
|
|
|
|
|
|
|
(fg42/all-the-icons-cube)
|
|
|
|
|
2021-12-12 11:15:23 +00:00
|
|
|
(defun fg42/statusbar-setter (def)
|
2021-12-12 19:51:09 +00:00
|
|
|
(unless (null def)
|
|
|
|
(setq-default fg42/statusbar-components
|
|
|
|
(plist-get (funcall def) :brief))
|
|
|
|
(setq-default fg42/statusbar-components
|
|
|
|
(plist-get (funcall #'fg42/statusbar-default) :brief))))
|
2021-12-12 11:15:23 +00:00
|
|
|
|
|
|
|
(setq fg42/modeline-setter #'fg42/statusbar-setter)
|
|
|
|
|
2023-06-10 20:47:55 +01:00
|
|
|
(add-hook 'fg42/after-init-hook
|
2021-12-12 11:15:23 +00:00
|
|
|
(lambda ()
|
|
|
|
(require 'fg42/statusbar)
|
|
|
|
(fg42/statusbar-mode t))))
|
2021-05-02 22:47:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
(provide 'cubes/modeline)
|
|
|
|
;;; modeline.el ends here
|