Compare commits
2 Commits
7f197504b5
...
71b8d8e278
Author | SHA1 | Date |
---|---|---|
Sameer Rahmani | 71b8d8e278 | |
Sameer Rahmani | 60d26d8331 |
13
flake.nix
13
flake.nix
|
@ -43,8 +43,8 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [ inputs.emacs-overlay.overlays.package ];
|
overlays = [ inputs.emacs-overlay.overlays.package ];
|
||||||
};
|
};
|
||||||
emacs = pkgs.emacs29.override {
|
emacs = pkgs.emacs29.override
|
||||||
} // (pkgs.lib.optionalAttrs (pkgs.stdenv.isLinux) {
|
{ } // (pkgs.lib.optionalAttrs (pkgs.stdenv.isLinux) {
|
||||||
# Gtk causes a flickering issue on WM mode
|
# Gtk causes a flickering issue on WM mode
|
||||||
withGTK3 = false;
|
withGTK3 = false;
|
||||||
toolkit = "lucid";
|
toolkit = "lucid";
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
noether = pkgs.emacsPackages.trivialBuild {
|
noether = pkgs.emacsPackages.trivialBuild {
|
||||||
pname = "noether";
|
pname = "noether";
|
||||||
version = "0.1.9";
|
version = "0.1.10";
|
||||||
buildInputs = [ pkgs.emacsPackages.posframe ];
|
buildInputs = [ pkgs.emacsPackages.posframe ];
|
||||||
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
@ -70,11 +70,12 @@
|
||||||
runtimeInputs = [ emacsPkgs ];
|
runtimeInputs = [ emacsPkgs ];
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
${emacsPkgs}/bin/emacs -Q -l ./test-noether.el "$@"
|
${emacsPkgs}/bin/emacs -Q -l ./test-noether.el "$@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
packages.default = noether;
|
packages.default = noether;
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = [ noether emacsPkgs test-noether ];
|
nativeBuildInputs = [ noether emacsPkgs test-noether ];
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
(defvar line-unit)
|
(defvar line-unit)
|
||||||
(defvar buffer-name-unit)
|
(defvar buffer-name-unit)
|
||||||
(defvar time-unit)
|
(defvar time-unit)
|
||||||
|
(defvar date-unit)
|
||||||
(defvar mode-name-unit)
|
(defvar mode-name-unit)
|
||||||
(defvar projectile-project-unit)
|
(defvar projectile-project-unit)
|
||||||
(declare-function projectile-project-name "projectile-project-name" ()))
|
(declare-function projectile-project-name "projectile-project-name" ()))
|
||||||
|
@ -105,7 +106,7 @@ Emacs knowing."
|
||||||
(defvar noether--timer nil)
|
(defvar noether--timer nil)
|
||||||
(defun noether--set-time ()
|
(defun noether--set-time ()
|
||||||
"Set the current time to the internal var which is being watched."
|
"Set the current time to the internal var which is being watched."
|
||||||
(setq noether--time (format-time-string "%m-%d %H:%M")))
|
(setq noether--time (format-time-string "%H:%M")))
|
||||||
|
|
||||||
(defun noether--time-format (_ v _ _)
|
(defun noether--time-format (_ v _ _)
|
||||||
"Just return the current time V."
|
"Just return the current time V."
|
||||||
|
@ -115,7 +116,7 @@ Emacs knowing."
|
||||||
(noether-defunit time-unit
|
(noether-defunit time-unit
|
||||||
"just the time for your bar."
|
"just the time for your bar."
|
||||||
:label "T:"
|
:label "T:"
|
||||||
:len 8
|
:len 5
|
||||||
:init (lambda ()
|
:init (lambda ()
|
||||||
(setq noether--timer
|
(setq noether--timer
|
||||||
(run-with-timer 1 1 #'noether--set-time)))
|
(run-with-timer 1 1 #'noether--set-time)))
|
||||||
|
@ -126,6 +127,35 @@ Emacs knowing."
|
||||||
:var 'noether--time
|
:var 'noether--time
|
||||||
:fn #'noether--time-format)
|
:fn #'noether--time-format)
|
||||||
|
|
||||||
|
;; ============================================================================
|
||||||
|
;; Daet indicator
|
||||||
|
;; ============================================================================
|
||||||
|
(defvar noether--date "")
|
||||||
|
(defvar noether--date-timer nil)
|
||||||
|
(defun noether--set-date ()
|
||||||
|
"Set the current date to the internal var which is being watched."
|
||||||
|
(setq noether--date (format-time-string "%m-%d")))
|
||||||
|
|
||||||
|
(defun noether--date-format (_ v _ _)
|
||||||
|
"Just return the current date V."
|
||||||
|
v)
|
||||||
|
|
||||||
|
|
||||||
|
(noether-defunit date-unit
|
||||||
|
"just the date for your bar."
|
||||||
|
:label "D:"
|
||||||
|
:len 5
|
||||||
|
:init (lambda ()
|
||||||
|
(noether--set-date)
|
||||||
|
(setq noether--date-timer
|
||||||
|
(run-with-timer 3600 1 #'noether--set-date)))
|
||||||
|
:deinit (lambda ()
|
||||||
|
(when noether--date-timer
|
||||||
|
(cancel-timer noether--date-timer)))
|
||||||
|
|
||||||
|
:var 'noether--date
|
||||||
|
:fn #'noether--date-format)
|
||||||
|
|
||||||
;; ============================================================================
|
;; ============================================================================
|
||||||
;; Mode name
|
;; Mode name
|
||||||
;; ============================================================================
|
;; ============================================================================
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(require 'seq)
|
(require 'seq)
|
||||||
(require 'posframe)
|
(require 'posframe)
|
||||||
|
(require 'subr-x)
|
||||||
|
|
||||||
(defgroup noether nil
|
(defgroup noether nil
|
||||||
"The customization group for the noether-mode."
|
"The customization group for the noether-mode."
|
||||||
|
@ -255,9 +256,6 @@ side BUF and F to it. It's simple trick to make small a closure."
|
||||||
(when (null f)
|
(when (null f)
|
||||||
(error (format "No `fn' in %s" unit)))
|
(error (format "No `fn' in %s" unit)))
|
||||||
|
|
||||||
(when init-fn
|
|
||||||
(funcall init-fn))
|
|
||||||
|
|
||||||
(when var
|
(when var
|
||||||
;; Setup the watcher and the watcher remover
|
;; Setup the watcher and the watcher remover
|
||||||
(add-variable-watcher var updater)
|
(add-variable-watcher var updater)
|
||||||
|
@ -268,6 +266,10 @@ side BUF and F to it. It's simple trick to make small a closure."
|
||||||
(remove-variable-watcher var updater))
|
(remove-variable-watcher var updater))
|
||||||
(get view-name :watcher-removers))))
|
(get view-name :watcher-removers))))
|
||||||
|
|
||||||
|
(when init-fn
|
||||||
|
(funcall init-fn))
|
||||||
|
|
||||||
|
|
||||||
(put view-name :updaters
|
(put view-name :updaters
|
||||||
(cons updater (get view-name :updaters)))
|
(cons updater (get view-name :updaters)))
|
||||||
|
|
||||||
|
|
|
@ -35,16 +35,17 @@
|
||||||
(require 'noether-views)
|
(require 'noether-views)
|
||||||
|
|
||||||
(defun noether--bottom-right (info)
|
(defun noether--bottom-right (info)
|
||||||
(cons (- (frame-outer-width) 10)
|
(cons -1 -1))
|
||||||
(- (frame-outer-height) 40))
|
|
||||||
)
|
(defun noether-autohide-on-echo (_)
|
||||||
|
(message "here")
|
||||||
|
(minibuffer-prompt))
|
||||||
|
|
||||||
(noether-defview mode-line
|
(noether-defview mode-line
|
||||||
"A simple and minimalist mode-line like status bar"
|
"A simple and minimalist mode-line like status bar"
|
||||||
:managed? t
|
:managed? t
|
||||||
:buffer "*modeline*"
|
:buffer "*modeline*"
|
||||||
;;:binding (kbd "C-c 1")
|
:binding (kbd "C-c 1")
|
||||||
:timeout 0
|
|
||||||
:separator "|"
|
:separator "|"
|
||||||
:visible? t
|
:visible? t
|
||||||
:frame
|
:frame
|
||||||
|
@ -53,14 +54,17 @@
|
||||||
;; (- (frame-outer-height) 40))
|
;; (- (frame-outer-height) 40))
|
||||||
:poshandler #'noether--bottom-right
|
:poshandler #'noether--bottom-right
|
||||||
:border-width 0
|
:border-width 0
|
||||||
|
;;:timeout 5
|
||||||
|
:hidehandler #'noether-autohide-on-echo
|
||||||
:border-color "#bd93f9")
|
:border-color "#bd93f9")
|
||||||
|
|
||||||
:units
|
:units
|
||||||
(list
|
(list
|
||||||
(line-unit :label "")
|
(line-unit :label "")
|
||||||
(buffer-name-unit :label "B: ")
|
(buffer-name-unit :label "B: ")
|
||||||
(mode-name-unit :label "M: ")))
|
(mode-name-unit :label "M: ")
|
||||||
|
(time-unit)
|
||||||
|
(date-unit)))
|
||||||
|
|
||||||
|
|
||||||
(setq noether-views (list mode-line))
|
(setq noether-views (list mode-line))
|
||||||
|
|
Loading…
Reference in New Issue