diff options
| -rw-r--r-- | attic/elisp/misc.el | 41 | ||||
| -rw-r--r-- | custom/jao-custom-completion.el | 6 | ||||
| -rw-r--r-- | custom/jao-custom-exwm.el | 3 | ||||
| -rw-r--r-- | custom/jao-custom-notmuch.el | 9 | ||||
| -rw-r--r-- | custom/jao-custom-x11.el | 2 | ||||
| -rw-r--r-- | init.el | 58 | ||||
| -rw-r--r-- | lib/eos/jao-borgmatic.el | 9 | ||||
| -rw-r--r-- | lib/net/jao-notmuch.el | 11 |
8 files changed, 72 insertions, 67 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el index 8808a5f..e0e13a9 100644 --- a/attic/elisp/misc.el +++ b/attic/elisp/misc.el @@ -128,39 +128,20 @@ ("M-O" . ace-swap-window) ("C-x 4 t" . ace-swap-window))) -;;; switch window -(use-package switch-window +;;; window navigation (spatial-window) +(use-package spatial-window :ensure t - :custom ((switch-window-minibuffer-shortcut ?z) - (switch-window-background t) - (switch-window-shortcut-style 'qwerty) - (switch-window-shortcut-appearance 'text) - (switch-window-timeout 7) - (switch-window-threshold 2)) :config - (defun jao-switch-window--then (prompt cmd) - (let ((f `(lambda () - (let ((default-directory ,default-directory)) - (call-interactively ',cmd))))) - (switch-window--then prompt f f))) - - (defun jao-switch-window-then-dired () - (interactive) - (jao-switch-window--then "Find directory" 'dired)) - - (defun jao-switch-window-then-find-file () - (interactive) - (jao-switch-window--then "Find file" 'find-file)) - - (defun jao-switch-window-then-consult-buffer () + (defun jao-spatial-window-select () (interactive) - (jao-switch-window--then "Switch to buffer" 'consult-buffer)) - - :bind (("s-o" . switch-window) - ("C-x 4 d" . jao-switch-window-then-dired) - ("C-x 4 f" . jao-switch-window-then-find-file) - ("C-x 4 b" . jao-switch-window-then-consult-buffer))) - + (let ((n (length (window-list)))) + (cond ((< n 2)) + ((< n 3) (other-window 1)) + (t (spatial-window-select))))) + :bind + ("M-o" . jao-spatial-window-select) + ("C-x o" . jao-spatial-window-select) + ("C-x p" . jao-spatial-window-select)) ;;; git helpers (use-package dired-git-info :ensure t diff --git a/custom/jao-custom-completion.el b/custom/jao-custom-completion.el index 2fe0ebf..ec020b8 100644 --- a/custom/jao-custom-completion.el +++ b/custom/jao-custom-completion.el @@ -13,11 +13,7 @@ completion-show-inline-help t completions-format 'one-column completion-styles '(basic substring partial-completion emacs22) - completion-category-overrides - '((file (styles partial-completion)) - (command (styles initials substring partial-completion)) - (symbol (styles initials substring partial-completion)) - (variable (styles initials substring partial-completion))) + completion-category-overrides '((file (styles partial-completion))) completion-wrap-movement t) (ffap-bindings) diff --git a/custom/jao-custom-exwm.el b/custom/jao-custom-exwm.el index 6b8b2c0..2aa4a8b 100644 --- a/custom/jao-custom-exwm.el +++ b/custom/jao-custom-exwm.el @@ -12,7 +12,8 @@ exwm-floating-border-color (if (jao-colors-scheme-dark-p) "black" "grey90") ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58245 : - x-no-window-manager t) + x-no-window-manager t + jao-minibuffer-maximized-frames-p t) :config (use-package jao-exwm :demand t) diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 4502334..5d44c24 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -329,7 +329,7 @@ :init (setq gnus-blocked-images "." notmuch-message-headers - '("Subject" "To" "Cc" "Date" "Reply-To" "List-Id" "X-RSS-Feed") + '("To" "Cc" "Date" "Reply-To" "List-Id" "X-RSS-Feed") ;; "Subject" notmuch-show-only-matching-messages t notmuch-show-part-button-default-action 'notmuch-show-view-part notmuch-wash-signature-lines-max 0 @@ -337,7 +337,7 @@ notmuch-wash-citation-lines-prefix 120 notmuch-wash-citation-lines-suffix 120 notmuch-show-text/html-blocked-images "." - notmuch-show-header-line nil ;; #'jao-notmuch-message-header-line + notmuch-show-header-line #'jao-notmuch-message-header-line ;; nil jao-notmuch-header-line-format "[%N / %M / %T] %n / %m / %t") :config @@ -460,8 +460,6 @@ (jump-to-register ?G)) (jao-notmuch-notify-and-update t)) - (defvar jao-notmuch--visits 0) - (defun jao-notmuch-tree--sentinel (proc) (when (eq (process-status proc) 'exit) (let ((inhibit-read-only t)) @@ -469,7 +467,8 @@ (goto-char (point-max)) (when (re-search-backward "^End of search results." nil t) (delete-line)))) - (jao-notmuch-thread-info-mode))) + ;; (jao-notmuch-thread-info-mode) + )) (add-hook 'notmuch-tree-process-exit-functions #'jao-notmuch-tree--sentinel) diff --git a/custom/jao-custom-x11.el b/custom/jao-custom-x11.el index 3922bc5..7d8b9cd 100644 --- a/custom/jao-custom-x11.el +++ b/custom/jao-custom-x11.el @@ -88,7 +88,7 @@ (make-symbolic-link f current t) (cond (jao-river-enabled (jao-river-set-wallpaper f)) (jao-sway-enabled (jao-sway-set-wallpaper f)) - (t (shell-command-to-string (format "xwallpaper --zoom %s" f))))))) + (t (shell-command-to-string (format "hsetroot -cover %s" f))))))) (defun jao-set-random-wallpaper () (interactive) @@ -1022,22 +1022,39 @@ (global-set-key "\C-xp" 'jao-prev-window) -;;;; window navigation (spatial-window) - -(use-package spatial-window +;;;; window navigation (switch-window) +(use-package switch-window :ensure t + :custom ((switch-window-minibuffer-shortcut ?z) + (switch-window-background t) + (switch-window-shortcut-style 'qwerty) + (switch-window-input-style 'minibuffer) + (switch-window-shortcut-appearance 'text) + (switch-window-timeout 7) + (switch-window-threshold 2)) :config - (defun jao-spatial-window-select () + (defun jao-switch-window--then (prompt cmd) + (let ((f `(lambda () + (let ((default-directory ,default-directory)) + (call-interactively ',cmd))))) + (switch-window--then prompt f f))) + + (defun jao-switch-window-then-dired () + (interactive) + (jao-switch-window--then "Find directory" 'dired)) + + (defun jao-switch-window-then-find-file () + (interactive) + (jao-switch-window--then "Find file" 'find-file)) + + (defun jao-switch-window-then-consult-buffer () (interactive) - (let ((n (length (window-list)))) - (cond ((< n 2)) - ((< n 3) (other-window 1)) - (t (spatial-window-select))))) + (jao-switch-window--then "Switch to buffer" 'consult-buffer)) - :bind - ("M-o" . jao-spatial-window-select) - ("C-x o" . jao-spatial-window-select) - ("C-x p" . jao-spatial-window-select)) + :bind (("M-o" . switch-window) + ("C-x 4 d" . jao-switch-window-then-dired) + ("C-x 4 f" . jao-switch-window-then-find-file) + ("C-x 4 b" . jao-switch-window-then-consult-buffer))) ;;;; transposing windows (defun transpose-windows (arg) @@ -2019,14 +2036,17 @@ (transient-define-prefix jao-transient-utils () "Global operations." [["Notes" - ("n" "create new note" jao-org-notes-create) - ("/" "open note" jao-org-notes-open) - ("\\" "open note by tags" jao-org-notes-consult-tags) - ("g" "ripgrep notes" jao-org-notes-consult-ripgrep)] + ("nn" "create new note" jao-org-notes-create) + ("n/" "open note" jao-org-notes-open) + ("n\\" "open note by tags" jao-org-notes-consult-tags) + ("ng" "ripgrep notes" jao-org-notes-consult-ripgrep)] ["Documents" ("dd" "go to doc" jao-select-pdf :if display-graphic-p) ("do" "open doc" jao-open-doc) ("dr" "search docs with recoll" jao-recoll-consult-docs)] + ["Workspaces" + ("e" "main" jao-exwm-firefox* :if jao-exwm-enabled-p) + ("g" "mail" jao-afio-goto-mail)] ["Monitors" ;; ("p" "list projects" list-projects) ;; ("p" "htop" jao-term-htop) @@ -2040,18 +2060,18 @@ ("S" "sieve" jao-sieve-manage)] ["Chats" ("c" "connect chats" jao-all-chats) - ("i" "irc" jao-chats-irc) + ("i" "irc buffer" jao-chats-irc) ("M" "mastodon" jao-mastodon) ("T" "telegram rooster" jao-telega)] ["Window system" :if jao-window-system-p ("w" "set wallpaper" jao-set-wallpaper) ("W" "set radom wallpaper" jao-set-random-wallpaper) - ("B u" (lambda () + ("Bu" (lambda () (let ((b (jao-x11-brightness))) (format "bright up %s" (and (string-match ".*\\((.+)\\).*" b) (match-string 1 b))))) jao-x11-bright-up :transient t) - ("B d" "bright down" jao-x11-bright-down :transient t)] + ("Bd" "bright down" jao-x11-bright-down :transient t)] ["Utilities" ("a" "aptitude" jao-term-aptitude) ("l" "packages" jao-list-packages) diff --git a/lib/eos/jao-borgmatic.el b/lib/eos/jao-borgmatic.el index f5d800d..6be370e 100644 --- a/lib/eos/jao-borgmatic.el +++ b/lib/eos/jao-borgmatic.el @@ -1,6 +1,6 @@ ;;; jao-borgmatic.el --- Simple access to borgmatic -*- lexical-binding: t; -*- -;; Copyright (C) 2022 jao +;; Copyright (C) 2022, 2026 jao ;; Author: jao <mail@jao.io> ;; Keywords: convenience @@ -116,8 +116,11 @@ (when (and (eq (process-status proc) 'exit) (y-or-n-p "Borg extraction finished, show?")) (if (eq (process-exit-status proc) 0) - (let ((d (file-name-directory (car paths)))) - (dired (expand-file-name d jao-borgmatic-extract-path))) + (let* ((d (file-name-directory (car paths))) + (p (expand-file-name d jao-borgmatic-extract-path))) + (if (file-exists-p p) + (dired p) + (message "%s is not in the archive" d))) (pop-to-buffer jao-borgmatic--extract-output))))) (defvar jao-borgmatic--extract-history nil) diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 0809d7b..db23bc1 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -402,7 +402,8 @@ (tb (seq-find (lambda (b) (with-current-buffer b (and (derived-mode-p 'notmuch-tree-mode) b))) - (buffer-list)))) + (buffer-list))) + (subject (propertize subject 'face 'message-header-subject))) `((:eval (jao-notmuch--format-header-line ,(buffer-name tb) ,cb ,subject))) (concat " " subject))) @@ -545,11 +546,15 @@ (t " ")))) (provide 'jao-notmuch) + ;;; bars +(defvar jao-notmuch-bar-max 188) + (defun jao-notmuch-hbar (margin) - (widget-insert (propertize (make-string (- (window-width) margin) ?—) - 'face '(:foreground "grey80"))) + (let ((w (- (min (window-width) jao-notmuch-bar-max) margin))) + (widget-insert (propertize (make-string w ?—) 'face '(:foreground "grey80")))) (newline)) + ;;; org links (defun jao-notmuch-id-file-name (id) (let ((cmd (format "notmuch search --output=files id:%s" id))) |
