2021-12-11 14:56:57 +00:00
|
|
|
;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*-
|
|
|
|
;;
|
2024-02-18 16:08:02 +00:00
|
|
|
;; Copyright (c) 2010-2024 Sameer Rahmani <lxsameer@gnu.org>
|
2021-12-11 14:56:57 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sameer Rahmani <lxsameer@gnu.org>
|
2022-12-19 21:07:48 +00:00
|
|
|
;; URL: https://devheroes.codes/FG42/FG42
|
2024-04-05 21:04:36 +01:00
|
|
|
;; Version: 4.0.0
|
2021-12-11 14:56:57 +00:00
|
|
|
;;
|
|
|
|
;; 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:
|
2024-03-23 12:06:01 +00:00
|
|
|
(eval-when-compile
|
|
|
|
(require 'fpkg))
|
2021-12-11 14:56:57 +00:00
|
|
|
|
2024-04-07 14:12:37 +01:00
|
|
|
(require 'fg42/utils)
|
2021-12-11 18:35:15 +00:00
|
|
|
|
2024-03-23 12:06:01 +00:00
|
|
|
(defvar fg42/modeline-views nil
|
|
|
|
"A list of Noether views to use for modeline.")
|
2021-12-11 14:56:57 +00:00
|
|
|
|
|
|
|
|
2024-04-07 14:12:37 +01:00
|
|
|
(defvar fg42/modeline-active-face nil
|
|
|
|
"Override the active modeline face via this var.")
|
|
|
|
|
|
|
|
(defvar fg42/modeline-inactive-face nil
|
|
|
|
"Override the inactive modeline face via this var.")
|
|
|
|
|
2024-03-23 12:06:01 +00:00
|
|
|
(defface fg42/-disabled-modeline-active-border
|
|
|
|
'((t
|
|
|
|
:background "#bd93f9" :height 0.1 :box nil))
|
|
|
|
"A new face for modeline in active state."
|
|
|
|
:group 'fg42)
|
2021-12-12 19:51:09 +00:00
|
|
|
|
|
|
|
|
2024-03-23 12:06:01 +00:00
|
|
|
(defface fg42/-disabled-modeline-dective-border
|
|
|
|
'((t
|
|
|
|
:background "#44475a" :height 0.1 :box nil))
|
|
|
|
"A new face for modeline in active state."
|
|
|
|
:group 'fg42)
|
2021-12-12 19:51:09 +00:00
|
|
|
|
2021-12-11 14:56:57 +00:00
|
|
|
|
2024-03-23 12:06:01 +00:00
|
|
|
(use! noether
|
|
|
|
"Smart mode line is a pretty simple yet fantastic alternative
|
|
|
|
to Emacs modeline."
|
|
|
|
:if (display-graphic-p)
|
2024-04-10 14:48:47 +01:00
|
|
|
;;:after projectile
|
2024-04-06 13:54:08 +01:00
|
|
|
:commands noether-global-mode
|
2024-03-23 12:06:01 +00:00
|
|
|
:config
|
|
|
|
(require 'noether-views)
|
2024-04-11 22:14:25 +01:00
|
|
|
(require 'fg42/modeline/views)
|
2021-12-11 14:56:57 +00:00
|
|
|
|
2024-04-07 14:12:37 +01:00
|
|
|
(let ((active-border (get-base16-color-or :base0A "#bd93f9"))
|
2024-04-08 11:45:43 +01:00
|
|
|
(inactive-border (get-base16-color-or :base03 "#44475a")))
|
2024-04-07 14:12:37 +01:00
|
|
|
(set-face-attribute 'fg42/-disabled-modeline-active-border nil :background active-border)
|
|
|
|
(set-face-attribute 'fg42/-disabled-modeline-dective-border nil :background inactive-border))
|
|
|
|
|
2024-03-23 12:06:01 +00:00
|
|
|
;; Disable the default modeline
|
|
|
|
(setq-default mode-line-format "")
|
|
|
|
(let ((face-remaps (default-value 'face-remapping-alist)))
|
2024-04-05 20:54:36 +01:00
|
|
|
(setf (alist-get 'mode-line face-remaps)
|
2024-04-07 14:12:37 +01:00
|
|
|
(if fg42/modeline-active-face fg42/modeline-active-face 'fg42/-disabled-modeline-active-border)
|
2024-04-05 20:54:36 +01:00
|
|
|
(alist-get 'mode-line-inactive face-remaps)
|
2024-04-07 14:12:37 +01:00
|
|
|
(if fg42/modeline-inactive-face fg42/modeline-inactive-face 'fg42/-disabled-modeline-dective-border)
|
2024-04-05 20:54:36 +01:00
|
|
|
(default-value 'face-remapping-alist) face-remaps))
|
2021-12-11 14:56:57 +00:00
|
|
|
|
2024-04-11 22:14:25 +01:00
|
|
|
;; Setup modelines
|
2024-04-09 21:01:41 +01:00
|
|
|
(when-not-wm
|
2024-04-11 22:56:23 +01:00
|
|
|
(setq-default noether-views (list fg42/modeline)))
|
|
|
|
(when-wm
|
|
|
|
(setq-default noether-views nil)))
|
2021-12-11 14:56:57 +00:00
|
|
|
|
|
|
|
(provide 'fg42/modeline)
|
|
|
|
;;; modeline.el ends here
|