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;
|
||||
overlays = [ inputs.emacs-overlay.overlays.package ];
|
||||
};
|
||||
emacs = pkgs.emacs29.override {
|
||||
} // (pkgs.lib.optionalAttrs (pkgs.stdenv.isLinux) {
|
||||
emacs = pkgs.emacs29.override
|
||||
{ } // (pkgs.lib.optionalAttrs (pkgs.stdenv.isLinux) {
|
||||
# Gtk causes a flickering issue on WM mode
|
||||
withGTK3 = false;
|
||||
toolkit = "lucid";
|
||||
|
@ -53,7 +53,7 @@
|
|||
|
||||
noether = pkgs.emacsPackages.trivialBuild {
|
||||
pname = "noether";
|
||||
version = "0.1.9";
|
||||
version = "0.1.10";
|
||||
buildInputs = [ pkgs.emacsPackages.posframe ];
|
||||
|
||||
src = ./.;
|
||||
|
@ -70,11 +70,12 @@
|
|||
runtimeInputs = [ emacsPkgs ];
|
||||
|
||||
text = ''
|
||||
${emacsPkgs}/bin/emacs -Q -l ./test-noether.el "$@"
|
||||
'';
|
||||
${emacsPkgs}/bin/emacs -Q -l ./test-noether.el "$@"
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
packages.default = noether;
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = [ noether emacsPkgs test-noether ];
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
(defvar line-unit)
|
||||
(defvar buffer-name-unit)
|
||||
(defvar time-unit)
|
||||
(defvar date-unit)
|
||||
(defvar mode-name-unit)
|
||||
(defvar projectile-project-unit)
|
||||
(declare-function projectile-project-name "projectile-project-name" ()))
|
||||
|
@ -105,7 +106,7 @@ Emacs knowing."
|
|||
(defvar noether--timer nil)
|
||||
(defun noether--set-time ()
|
||||
"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 _ _)
|
||||
"Just return the current time V."
|
||||
|
@ -115,7 +116,7 @@ Emacs knowing."
|
|||
(noether-defunit time-unit
|
||||
"just the time for your bar."
|
||||
:label "T:"
|
||||
:len 8
|
||||
:len 5
|
||||
:init (lambda ()
|
||||
(setq noether--timer
|
||||
(run-with-timer 1 1 #'noether--set-time)))
|
||||
|
@ -126,6 +127,35 @@ Emacs knowing."
|
|||
:var 'noether--time
|
||||
: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
|
||||
;; ============================================================================
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
;;; Code:
|
||||
(require 'seq)
|
||||
(require 'posframe)
|
||||
(require 'subr-x)
|
||||
|
||||
(defgroup noether nil
|
||||
"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)
|
||||
(error (format "No `fn' in %s" unit)))
|
||||
|
||||
(when init-fn
|
||||
(funcall init-fn))
|
||||
|
||||
(when var
|
||||
;; Setup the watcher and the watcher remover
|
||||
(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))
|
||||
(get view-name :watcher-removers))))
|
||||
|
||||
(when init-fn
|
||||
(funcall init-fn))
|
||||
|
||||
|
||||
(put view-name :updaters
|
||||
(cons updater (get view-name :updaters)))
|
||||
|
||||
|
|
|
@ -35,16 +35,17 @@
|
|||
(require 'noether-views)
|
||||
|
||||
(defun noether--bottom-right (info)
|
||||
(cons (- (frame-outer-width) 10)
|
||||
(- (frame-outer-height) 40))
|
||||
)
|
||||
(cons -1 -1))
|
||||
|
||||
(defun noether-autohide-on-echo (_)
|
||||
(message "here")
|
||||
(minibuffer-prompt))
|
||||
|
||||
(noether-defview mode-line
|
||||
"A simple and minimalist mode-line like status bar"
|
||||
:managed? t
|
||||
:buffer "*modeline*"
|
||||
;;:binding (kbd "C-c 1")
|
||||
:timeout 0
|
||||
:binding (kbd "C-c 1")
|
||||
:separator "|"
|
||||
:visible? t
|
||||
:frame
|
||||
|
@ -53,14 +54,17 @@
|
|||
;; (- (frame-outer-height) 40))
|
||||
:poshandler #'noether--bottom-right
|
||||
:border-width 0
|
||||
|
||||
;;:timeout 5
|
||||
:hidehandler #'noether-autohide-on-echo
|
||||
:border-color "#bd93f9")
|
||||
|
||||
:units
|
||||
(list
|
||||
(line-unit :label "")
|
||||
(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))
|
||||
|
|
Loading…
Reference in New Issue