tool bar icons

This commit is contained in:
2025-11-08 11:49:00 +01:00
parent 3c5abef2a6
commit 2ded09cca7
38 changed files with 313 additions and 53 deletions

View File

@@ -1,6 +1,8 @@
org-ob-core.el-add-ability-to-use-closures-as-default-header-args.patch
- patch -d "$HOME/.config/emacs/lisp/org" -p1 -i $HOME/.config/emacs/lisp/0patches/org-ob-core.el-add-ability-to-use-closures-as-default-header-args.patch
- patch -R -d "$HOME/.config/emacs/lisp/org" -p1 -i $HOME/.config/emacs/lisp/0patches/org-ob-core.el-add-ability-to-use-closures-as-default-header-args.patch
- apply patch
patch -d "$HOME/.config/emacs/lisp/org" -p1 -i $HOME/.config/emacs/lisp/0patches/org-ob-core.el-add-ability-to-use-closures-as-default-header-args.patch
- reverse patch
patch -R -d "$HOME/.config/emacs/lisp/org" -p1 -i $HOME/.config/emacs/lisp/0patches/org-ob-core.el-add-ability-to-use-closures-as-default-header-args.patch
- https://orgmode.org/list/87ftflikkc.fsf@gmail.com/t/
- https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00464.html
- https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/txtzi_PffIaG1.txt

View File

@@ -220,7 +220,7 @@
;;; Require
(require 'cl-lib)
(require 'subr-x)
(require 'battery)
;; (require 'battery) ;; moved inside `awesome-tray-module-battery-info' to reduce loading time ~0.03s
(require 'timer)
(require 'minibuffer)
(require 'overlay)
@@ -330,7 +330,8 @@ If nil, don't update the awesome-tray automatically."
(defcustom awesome-tray-active-modules
'("location" "belong" "file-path" "mode-name" "battery" "date")
"Default active modules."
"Default active modules.
See available modules in `awesome-tray-module-alist'."
:type 'list
:group 'awesome-tray)
@@ -772,6 +773,7 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
""))
(defun awesome-tray-module-battery-info ()
(require 'battery)
(let ((current-seconds (awesome-tray-current-seconds)))
(if (> (- current-seconds awesome-tray-battery-status-last-time) awesome-tray-battery-update-duration)
(let* ((battery-info (funcall battery-status-function))
@@ -1011,7 +1013,7 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
(when (and (> (point) (treesit-node-start node))
(< (point) (treesit-node-end node)))
(throw 'found (treesit-node-text node))))
(t
(_ ;; replace t with _
(when (and (> (point) (treesit-node-start (treesit-node-parent node)))
(< (point) (treesit-node-end (treesit-node-parent node))))
(throw 'found (treesit-node-text node)))))))
@@ -1029,7 +1031,7 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
(when (and (> (point) (treesit-node-start (treesit-node-parent node)))
(< (point) (treesit-node-end (treesit-node-parent node))))
(throw 'found (treesit-node-text node))))
(t
(_ ;; replace t with _
(when (and (> (point) (treesit-node-start (treesit-node-parent node)))
(< (point) (treesit-node-end (treesit-node-parent node))))
(throw 'found (treesit-node-text node)))))))

View File

@@ -10,6 +10,16 @@
(defvar my-tool-bar-separator " "
"Separator.")
(defun my-tool-bar-function-open (event)
"Run `find-file' or 'counsel-find-file' if available."
(interactive "e")
(let ()
(if (featurep 'counsel)
(counsel-find-file)
(find-file))))
(defvar my-tool-bar-button-open "Open "
"Button to run `find-file' or `counsel-find-file' if available.")
(defun my-tool-bar-function-save (event)
"Run `save-buffer'."
(interactive "e")
@@ -21,15 +31,13 @@
(defvar my-tool-bar-button-save "Save "
"Button to run `save-buffer'.")
(defun my-tool-bar-function-open (event)
"Run `find-file' or 'counsel-find-file' if available."
(defun my-tool-bar-function-save-as (event)
"Run `my-org-export'."
(interactive "e")
(let ()
(if (featurep 'counsel)
(counsel-find-file)
(find-file))))
(defvar my-tool-bar-button-open "Open "
"Button to run `find-file' or `counsel-find-file' if available.")
(my-org-export) ))
(defvar my-tool-bar-button-save "Save as "
"Button to run `my-org-export'.")
(defun my-tool-bar-function-cancle (event)
"Run `keyboard-escape-quit'."
@@ -98,6 +106,16 @@
(defvar my-tool-bar-button-fill "Fill "
"Button to run `fill-region'.")
(defun my-tool-bar-function-comment (event)
"Run `comment-or-uncomment-region'."
(interactive "e")
(let ()
(comment-or-uncomment-region (region-beginning) (region-end))
;; (comment-dwim)
))
(defvar my-tool-bar-button-fill "Comment "
"Button to run `comment-or-uncomment-region'.")
(defun my-tool-bar-function-spell (event)
"Run `flyspell-mode' and `flyspell-buffer'."
(interactive "e")
@@ -132,50 +150,90 @@
These buttons will be shown when `my-tool-bar-mode' is enabled.
You can hide these buttons by customizing `tab-bar-format' and removing
`my-tool-bar-format' from it."
;; (propertize "`save-buffer'" 'face '(:foreground "red"))
;; (propertize "`save-buffer'" 'face 'font-lock-constant-face)
(when my-tool-bar-mode
`(;;(sep-history-back menu-item ,(tab-bar-separator) ignore)
(save
menu-item ,my-tool-bar-button-save my-tool-bar-function-save
;; :enable buffer-modified-p
:help "Save / `save-buffer'")
;;(sep-test menu-item "" ignore)
(open
menu-item ,my-tool-bar-button-open my-tool-bar-function-open
:help "Open File... / `find-file'")
:help (concat "Open File... "
(propertize "`find-file'"
'face 'font-lock-constant-face)))
(save
menu-item ,my-tool-bar-button-save my-tool-bar-function-save
;; :enable buffer-modified-p
:help (concat "Save "
(propertize "`save-buffer'"
'face 'font-lock-constant-face)))
(save-as
menu-item ,my-tool-bar-button-save-as my-tool-bar-function-save-as
:help (concat "Save as "
(propertize "`my-org-export'"
'face 'font-lock-constant-face)))
(cancle
menu-item ,my-tool-bar-button-cancle my-tool-bar-function-cancle
:help "Cancle / `keyboard-escape-quit'")
:help (concat "Cancle "
(propertize "`keyboard-escape-quit'"
'face 'font-lock-constant-face)))
(sep-1 menu-item ,(tab-bar-separator) ignore)
(revert
menu-item ,my-tool-bar-button-revert my-tool-bar-function-revert
:help "Re-read current buffer from its file / `revert-buffer'")
:help (concat "Re-read current buffer from its file "
(propertize "`revert-buffer'"
'face 'font-lock-constant-face)))
(undo
menu-item ,my-tool-bar-button-undo my-tool-bar-function-undo
:help "Undo / `undo-only'")
:help (concat "Undo "
(propertize "`undo-only'"
'face 'font-lock-constant-face)))
(redo
menu-item ,my-tool-bar-button-redo my-tool-bar-function-redo
:help "Redo / `undo-redo'")
:help (concat "Redo "
(propertize "`undo-redo'"
'face 'font-lock-constant-face)))
(cut
menu-item ,my-tool-bar-button-cut my-tool-bar-function-cut
:help "Cut text of region / `kill-region'")
:help (concat "Cut text of region "
(propertize "`kill-region'"
'face 'font-lock-constant-face)))
(copy
menu-item ,my-tool-bar-button-copy my-tool-bar-function-copy
:help "Copy text of region / `kill-ring-save'")
:help (concat "Copy text of region "
(propertize "`kill-ring-save'"
'face 'font-lock-constant-face)))
(paste
menu-item ,my-tool-bar-button-paste my-tool-bar-function-paste
:help "Paste text / `yank'")
:help (concat "Paste text "
(propertize "`yank'"
'face 'font-lock-constant-face)))
(fill
menu-item ,my-tool-bar-button-fill my-tool-bar-function-fill
:help "Fill text in region to fit between left and right margin / `fill-region'")
:help (concat "Fill text in region to fit between left and right margin "
(propertize "`fill-region'"
'face 'font-lock-constant-face)))
(comment
menu-item ,my-tool-bar-button-comment my-tool-bar-function-comment
:help (concat "Comment text in region "
(propertize "`comment-or-uncomment-region'"
'face 'font-lock-constant-face)))
(sep-2 menu-item ,(tab-bar-separator) ignore)
;; (sep-2 menu-item ,my-tool-bar-separator ignore
;; :enable nil :help "")
(spell
menu-item ,my-tool-bar-button-spell my-tool-bar-function-spell
:help "Spell checking / `flyspell-mode' and `flyspell-buffer'")
:help (concat "Spell checking "
(propertize "`flyspell-mode',`flyspell-buffer'"
'face 'font-lock-constant-face)))
(langtool
menu-item ,my-tool-bar-button-langtool my-tool-bar-function-langtool
:help "LanguageTool / `langtool-check-buffer'")
:help (concat "LanguageTool "
(propertize "`langtool-check-buffer'"
'face 'font-lock-constant-face)))
(sep-tool-bar menu-item ,(my-tool-bar-newline) ignore))))
(defun my-tool-bar--load-buttons ()
@@ -202,26 +260,11 @@ See `icon-preference' for the order of type preference."
:version "29.1"))
(setq my-tool-bar-separator (icon-string 'my-tool-bar-icon-separator))
(unless (iconp 'my-tool-bar-icon-save)
(define-icon my-tool-bar-icon-save nil
`((image ;; "save.xpm"
"Fluent-dark/document-save.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
(emoji "💾")
(symbol "🖫 ") ;; 🖪 🖫 🖬
(text "Save "
;; :face tab-bar-tab-inactive
))
"Icon for save."
:version "29.1"))
(setq my-tool-bar-button-save (icon-string 'my-tool-bar-icon-save))
(unless (iconp 'my-tool-bar-icon-open)
(define-icon my-tool-bar-icon-open nil
`((image ;; "open.xpm"
"Fluent-dark/document-open.svg"
;; "Fluent-dark/document-open.svg"
"Fluent-dark/document-open-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -234,10 +277,41 @@ See `icon-preference' for the order of type preference."
:version "29.1"))
(setq my-tool-bar-button-open (icon-string 'my-tool-bar-icon-open))
(unless (iconp 'my-tool-bar-icon-save)
(define-icon my-tool-bar-icon-save nil
`((image ;; "save.xpm"
;; "Fluent-dark/document-save.svg"
"Fluent-dark/document-save-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
(emoji "💾")
(symbol "🖫 ") ;; 🖪 🖫 🖬
(text "Save "
;; :face tab-bar-tab-inactive
))
"Icon for save."
:version "29.1"))
(setq my-tool-bar-button-save (icon-string 'my-tool-bar-icon-save))
(unless (iconp 'my-tool-bar-icon-save-as)
(define-icon my-tool-bar-icon-save-as nil
`((image "Fluent-dark/document-save-as-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
(text "Save as "
;; :face tab-bar-tab-inactive
))
"Icon for save as."
:version "29.1"))
(setq my-tool-bar-button-save-as (icon-string 'my-tool-bar-icon-save-as))
(unless (iconp 'my-tool-bar-icon-cancle)
(define-icon my-tool-bar-icon-cancle nil
`((image ;; "cancel.xpm"
"Fluent-dark/dialog-cancel.svg"
;; "Fluent-dark/dialog-cancel.svg"
"Fluent-dark/builder-build-stop-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -253,7 +327,8 @@ See `icon-preference' for the order of type preference."
(unless (iconp 'my-tool-bar-icon-revert)
(define-icon my-tool-bar-icon-revert nil
`((image ;; "refresh.xpm"
"Fluent-dark/view-refresh.svg"
;; "Fluent-dark/view-refresh.svg"
"Fluent-dark/emblem-synchronizing-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -268,7 +343,8 @@ See `icon-preference' for the order of type preference."
(unless (iconp 'my-tool-bar-icon-undo)
(define-icon my-tool-bar-icon-undo nil
`((image ;; "undo.xpm"
"Fluent-dark/edit-undo.svg"
;; "Fluent-dark/edit-undo.svg"
"Fluent-dark/edit-undo-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -283,7 +359,8 @@ See `icon-preference' for the order of type preference."
(unless (iconp 'my-tool-bar-icon-redo)
(define-icon my-tool-bar-icon-redo nil
`((image ;; "redo.xpm"
"Fluent-dark/edit-redo.svg"
;; "Fluent-dark/edit-redo.svg"
"Fluent-dark/edit-redo-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -298,7 +375,8 @@ See `icon-preference' for the order of type preference."
(unless (iconp 'my-tool-bar-icon-cut)
(define-icon my-tool-bar-icon-cut nil
`((image ;; "cut.xpm"
"Fluent-dark/edit-cut.svg"
;; "Fluent-dark/edit-cut.svg"
"Fluent-dark/edit-cut-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -314,7 +392,8 @@ See `icon-preference' for the order of type preference."
(unless (iconp 'my-tool-bar-icon-copy)
(define-icon my-tool-bar-icon-copy nil
`((image ;; "copy.xpm"
"Fluent-dark/edit-copy.svg"
;; "Fluent-dark/edit-copy.svg"
"Fluent-dark/edit-copy-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -329,7 +408,8 @@ See `icon-preference' for the order of type preference."
(unless (iconp 'my-tool-bar-icon-paste)
(define-icon my-tool-bar-icon-paste nil
`((image ;; "paste.xpm"
"Fluent-dark/edit-paste.svg"
;; "Fluent-dark/edit-paste.svg"
"Fluent-dark/edit-paste-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -345,7 +425,8 @@ See `icon-preference' for the order of type preference."
(unless (iconp 'my-tool-bar-icon-fill)
(define-icon my-tool-bar-icon-fill nil
`((image ;; "newsticker/narrow.xpm"
"Fluent-dark/format-text-direction-horizontal.svg"
;; "Fluent-dark/format-text-direction-horizontal.svg"
"Fluent-dark/format-justify-fill-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
@@ -357,6 +438,17 @@ See `icon-preference' for the order of type preference."
:version "29.1"))
(setq my-tool-bar-button-fill (icon-string 'my-tool-bar-icon-fill))
(unless (iconp 'my-tool-bar-icon-comment)
(define-icon my-tool-bar-icon-comment nil
`((image "Fluent-dark/xapp-annotations-text-symbolic.svg"
:height (1.5 . em)
:margin ,tab-bar-button-margin
:ascent center)
(text "Comment " ))
"Icon for comment region."
:version "29.1"))
(setq my-tool-bar-button-comment (icon-string 'my-tool-bar-icon-comment))
(unless (iconp 'my-tool-bar-icon-spell)
(define-icon my-tool-bar-icon-spell nil
`((image ;; "spell.xpm"