FG42/lisp/fg42/status.el

74 lines
2.2 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: 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:
;; Some of the functions in this module are borrowed from `mini-modeline'
;; at https://github.com/kiennq/emacs-mini-modeline (GPL). I modified to
;; fit my needs.
;;; Require
(require 'fpkg)
(fpkg/require 'all-the-icons)
(fpkg/require 'posframe)
(defvar fg42/status-buffer "*status-buffer*"
"The name of the status buffer to use.")
(defun fg42/status-show ()
(interactive)
(with-current-buffer fg42/status-buffer
(erase-buffer)
(insert (propertize (all-the-icons-octicon "package")
'face `(:family ,(all-the-icons-octicon-family) :height 1)
;; 'display '(raise -0.1)
) )
(insert "| A | B | C"))
(posframe-show
fg42/status-buffer
:min-height 1
:min-width 10
:position (cons (- (frame-outer-width) 10) (- (frame-outer-height) 10))
;;:poshandler #'posframe-poshandler-frame-bottom-right-corner
;;:border-width 1
:border-color "#aa00bb"
:accept-focus nil
:timeout 5
:refresh 1))
(posframe-delete-all)
(define-minor-mode fg42/global-statue-mode
"A minor mode that keep tracks of different status blocks.
It reports them back in a status bar like frame."
:global t
:lighter " ST42"
:keymap (let ((map (make-sparse-keymap)))))
(fg42/global-statue-mode)
(provide 'status.el)
;;; status.el ends here