FG42/lisp/fg42/modeline/views.el

84 lines
2.4 KiB
EmacsLisp

;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2010-2024 Sameer Rahmani <lxsameer@gnu.org>
;;
;; Author: Sameer Rahmani <lxsameer@gnu.org>
;; URL: https://devheroes.codes/FG42/FG42
;; Version: 4.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:
(eval-when-compile
(require 'fpkg))
(require 'fg42/modeline/units)
(noether-defview fg42/modeline
"A simple and minimalist mode-line like status bar"
:managed? t
:binding (kbd "C-c 0")
:buffer "*modeline"
:visible? t
:timeout 0
:frame
(list
:position
(cons (- (frame-inner-width) 690)
(- (frame-outer-height) 20))
:border-width 0
:border-color "#bd93f9")
:units
(list
(buffer-name-unit :label (format "%s " (nerd-icons-codicon "nf-cod-layers"))
:len 20)
;; (mode-name-unit :label " " :len 4)
(projectile-project-unit :label (format "%s " (nerd-icons-octicon "nf-oct-project"))
:len 20)
(git-branch-unit :label (format "%s " (nerd-icons-devicon "nf-dev-git_branch"))
:len 20)
(fg42/mode-icon)
(line-unit :label "")))
(when-wm
(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 '(10000 . 10000)
:border-width 0
:timeout 5
:border-color "#bd93f9")
:units
(list
(fg42/exwm-input-mode-unit :label "")
(buffer-name-unit :label "")
(time-unit :label ""))))
(provide 'fg42/modeline/views)
;;; views.el ends here