2024-04-05 15:29:15 +01:00
|
|
|
;;; noether.el --- A modeline which plays hide and seek -*- lexical-binding: t; -*-
|
|
|
|
;;
|
2024-04-10 16:02:02 +01:00
|
|
|
;; Copyright (c) 2023-2024 Sameer Rahmani <lxsameer@gnu.org>
|
2024-04-05 15:29:15 +01:00
|
|
|
;;
|
|
|
|
;; Author: Sameer Rahmani <lxsameer@gnu.org>
|
|
|
|
;; URL: https://devheroes.codes/lxsameer/noether
|
|
|
|
;; Version: 0.1.0
|
|
|
|
;; Keywords: frames, modeline
|
|
|
|
;; Package-Requires: ((posframe "1.4.2") (emacs "27.1"))
|
|
|
|
;;
|
|
|
|
;; 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:
|
|
|
|
;; A simple frame manager framework that can be utilized to create a mode line
|
|
|
|
;; alternative.
|
|
|
|
;;; Change Log:
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
|
|
|
|
(setq debug-on-error t)
|
|
|
|
|
|
|
|
(require 'noether)
|
|
|
|
(require 'noether-units)
|
|
|
|
(require 'noether-views)
|
2024-05-02 12:17:58 +01:00
|
|
|
(load-theme 'tsdh-dark)
|
|
|
|
|
2024-05-11 18:52:33 +01:00
|
|
|
(defmacro comment (&rest _) nil)
|
2024-04-05 15:29:15 +01:00
|
|
|
|
2024-04-10 20:23:09 +01:00
|
|
|
(defun noether--bottom-right (info)
|
2024-04-19 20:10:41 +01:00
|
|
|
(cons -1 -1))
|
|
|
|
|
|
|
|
(defun noether-autohide-on-echo (_)
|
|
|
|
(minibuffer-prompt))
|
2024-04-10 20:23:09 +01:00
|
|
|
|
2024-05-11 18:52:33 +01:00
|
|
|
(comment
|
|
|
|
(with-current-buffer (get-buffer "*modeline*")
|
|
|
|
(set-frame-parameter posframe--frame 'sticky t)
|
|
|
|
(pp (frame-parameters posframe--frame))))
|
|
|
|
;; (setq f1 (make-frame '((name . "f1") )))
|
|
|
|
;; (setq f2 (make-frame '((name . "f2") )))
|
|
|
|
;; (setq f3 (make-frame '((name . "f3") )))
|
|
|
|
|
|
|
|
;; (nth 3 (frame-list))
|
|
|
|
;; (visible-frame-list)
|
|
|
|
;; (select-frame (nth 2 (frame-list)))
|
2024-05-02 12:17:58 +01:00
|
|
|
|
2024-04-05 15:29:15 +01:00
|
|
|
(noether-defview mode-line
|
|
|
|
"A simple and minimalist mode-line like status bar"
|
|
|
|
:managed? t
|
|
|
|
:buffer "*modeline*"
|
2024-04-19 19:32:00 +01:00
|
|
|
:binding (kbd "C-c 1")
|
2024-04-05 15:29:15 +01:00
|
|
|
:separator "|"
|
|
|
|
:visible? t
|
|
|
|
:frame
|
|
|
|
(list
|
2024-05-11 18:52:33 +01:00
|
|
|
:name "modeline"
|
2024-04-10 20:23:09 +01:00
|
|
|
;; :position (cons (- (frame-outer-width) 10)
|
|
|
|
;; (- (frame-outer-height) 40))
|
|
|
|
:poshandler #'noether--bottom-right
|
2024-04-05 15:29:15 +01:00
|
|
|
:border-width 0
|
2024-05-11 18:52:33 +01:00
|
|
|
|
|
|
|
;; :parent-frame f1
|
2024-04-19 19:32:00 +01:00
|
|
|
;;:timeout 5
|
2024-04-19 20:10:41 +01:00
|
|
|
:hidehandler #'noether-autohide-on-echo
|
2024-04-05 15:29:15 +01:00
|
|
|
:border-color "#bd93f9")
|
|
|
|
|
|
|
|
:units
|
|
|
|
(list
|
|
|
|
(line-unit :label "")
|
|
|
|
(buffer-name-unit :label "B: ")
|
2024-05-11 18:52:33 +01:00
|
|
|
))
|
2024-04-05 15:29:15 +01:00
|
|
|
|
|
|
|
|
2024-05-02 12:17:58 +01:00
|
|
|
(noether-defview minibuffer-ex
|
|
|
|
"A simple and minimalist mode-line like status bar"
|
|
|
|
:managed? t
|
|
|
|
:buffer "*modeline*"
|
|
|
|
:binding (kbd "C-c 2")
|
2024-05-11 18:52:33 +01:00
|
|
|
:visible? t
|
|
|
|
:sticky? t
|
2024-05-11 20:12:53 +01:00
|
|
|
:hide-when-minibuffer? t
|
2024-05-02 12:17:58 +01:00
|
|
|
:frame
|
|
|
|
(list
|
2024-05-11 18:52:33 +01:00
|
|
|
:name "ex"
|
|
|
|
:explicit-name "ex"
|
2024-05-02 12:17:58 +01:00
|
|
|
:poshandler #'posframe-poshandler-frame-center
|
|
|
|
:border-width 1
|
2024-05-11 18:52:33 +01:00
|
|
|
;; :parent-frame f2
|
2024-05-02 12:17:58 +01:00
|
|
|
;; :hidehandler #'noether-autohide-on-echo
|
|
|
|
:border-color "#bd93f9")
|
|
|
|
|
|
|
|
:units
|
|
|
|
(list
|
|
|
|
(mode-name-unit :label "M: ")
|
2024-05-11 18:52:33 +01:00
|
|
|
|
2024-05-11 20:12:53 +01:00
|
|
|
(project-unit)))
|
2024-05-02 12:17:58 +01:00
|
|
|
|
2024-05-11 18:52:33 +01:00
|
|
|
(setq noether-views (list minibuffer-ex ))
|
2024-04-05 16:19:54 +01:00
|
|
|
|
2024-04-05 15:29:15 +01:00
|
|
|
(noether-global-mode t)
|
|
|
|
|
|
|
|
|
|
|
|
(provide 'test-noether)
|
|
|
|
;;; test-noether.el ends here
|