Revert "Revert "add org-download and config""

This reverts commit 617c86d44b7579e5c9c755e57a38933638f4e355.
This commit is contained in:
cho 2023-09-28 20:11:31 +07:00
parent f2aa8f935c
commit 25665457f4
3 changed files with 45 additions and 10 deletions

View File

@ -33,14 +33,15 @@
;; There are two ways to load a theme. Both assume the theme is installed and ;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the ;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default: ;; `load-theme' function. This is the default:
(setq doom-theme 'doom-tomorrow-night) ;(setq doom-theme 'doom-tomorrow-night)
;(setq doom-theme 'doom-one) ;(setq doom-theme 'doom-one)
;(setq doom-theme 'doom-wilmersdorf) ;(setq doom-theme 'doom-wilmersdorf)
;(setq doom-theme 'doom-plain-dark) ;(setq doom-theme 'doom-plain-dark)
;(setq doom-theme 'doom-feather-dark) ;(setq doom-theme 'doom-feather-dark)
;(setq doom-theme 'doom-monokai-ristretto)
;(setq doom-theme 'doom-plain) ;(setq doom-theme 'doom-plain)
;(setq doom-theme 'doom-flatwhite) (setq doom-theme 'doom-flatwhite)
;; This determines the style of line numbers in effect. If set to `nil', line ;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'. ;; numbers are disabled. For relative line numbers, set this to `relative'.
@ -195,11 +196,14 @@
; (concat "${type:15} ${title:*} " (propertize "${tags:10}" 'face 'org-tag))) ; (concat "${type:15} ${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
;;; org-capture stuff ;;; org-capture stuff
;;; examples: file:~/.emacs.d/modules/lang/org/config.el
; my location of the todo.org file
(setq +org-capture-todo-file "ag/todo.org") (setq +org-capture-todo-file "ag/todo.org")
;; this sets Personal notes to refile instead
(defvar +org-capture-refile-file "refile.org") (defvar +org-capture-refile-file "refile.org")
(setq +org-capture-refile-file (setq +org-capture-refile-file
(expand-file-name +org-capture-refile-file org-directory)) (expand-file-name +org-capture-refile-file org-directory))
; refile.org at the root of org-directory
;(add-to-list 'org-capture-templates ;(add-to-list 'org-capture-templates
; '(("s" "Slipbox" entry (file "braindump/org/inbox.org") ; '(("s" "Slipbox" entry (file "braindump/org/inbox.org")
@ -212,16 +216,20 @@
(setq org-capture-templates (setq org-capture-templates
'(("t" "Personal todo" entry '(("t" "Personal todo" entry
(file+headline +org-capture-todo-file "todo") (file+headline +org-capture-todo-file "todo")
"* [ ] %?\n%i\n%a") "* [ ] %?\n%i\n%a" :prepend t)
("T" "Personal todo (single)" entry ("T" "Personal todo (no link)" entry
(file+headline +org-capture-todo-file "todo") (file+headline +org-capture-todo-file "todo")
"* [ ] %?\n") "* [ ] %?\n" :prepend t)
("n" "Personal notes" entry ;;; i never use this
;("n" "Personal notes" entry
;(file+headline +org-capture-notes-file "Inbox")
;"* %u %?\n%i\n%a" :prepend t)
("r" "Personal refile file" entry
(file +org-capture-refile-file) (file +org-capture-refile-file)
"* %u %?\n%i\n%a" :prepend t) "* %u %?\n%i\n%a" :prepend t)
;; using org-journal atm.. ;; using org-journal atm, i will likely never use this
;("j" "Journal" entry ;("j" "Journal" entry
;(file+olp+datetree +org-capture-journal-file) ;(file+olp+datetree +org-capture-journal-file)
;"* %U %?\n%i\n%a" :prepend t) ;"* %U %?\n%i\n%a" :prepend t)
@ -241,6 +249,7 @@
(file+headline +org-capture-project-changelog-file "Unreleased") (file+headline +org-capture-project-changelog-file "Unreleased")
"* %U %?\n%i\n%a" :prepend t) "* %U %?\n%i\n%a" :prepend t)
;; reference for function: [[file:~/.emacs.d/modules/lang/org/autoload/org-capture.el::defun +org--capture-central-file (file project]]
;; Will use {org-directory}/{+org-capture-projects-file} and store ;; Will use {org-directory}/{+org-capture-projects-file} and store
;; these under {ProjectName}/{Tasks,Notes,Changelog} headings. They ;; these under {ProjectName}/{Tasks,Notes,Changelog} headings. They
;; support `:parents' to specify what headings to put them under, e.g. ;; support `:parents' to specify what headings to put them under, e.g.
@ -263,13 +272,16 @@
:prepend t) :prepend t)
;; org books / general logging ;; org books / general logging
("b" "Book log" item (function org-books-visit-book-log) ("b" "Book log / General log (org)" item (function org-books-visit-book-log)
"- %U %?" :prepend t) "- %U %?" :prepend t)
;; zettelkasten ;; zettelkasten
("s" "Slipbox" entry (file "roam/inbox.org") ("s" "Slipbox" entry (file "roam/inbox.org")
"* %?\n"))) "* %U %?\n")
("S" "Slipbox link" entry (file "roam/inbox.org")
"* %U %?\n %i\n %a")))
(setq org-attach-directory "~/notebook/images/attach/")
) )
;;; end of (!after org ... ;;; end of (!after org ...
@ -317,3 +329,15 @@
"Archive all done tasks." "Archive all done tasks."
(interactive) (interactive)
(org-map-entries 'org-archive-subtree "/DONE" 'file)) (org-map-entries 'org-archive-subtree "/DONE" 'file))
(require 'org-download)
(setq-default
org-download-method 'directory
;; org-download-screenshot-method "grimshot save window %s"
;; org-download-screenshot-method "wl-paste -t image/png > '%s'"
;; below script is available on dotfiles: ../.local/bin
org-download-screenshot-method "convert-paste-png.sh '%s'"
org-download-image-dir "~/notebook/images/org-download"
org-download-heading-lvl nil
org-download-timestamp "%Y%m%d-%H%M%S_")
(add-hook 'dired-mode-hook 'org-download-enable)

View File

@ -56,6 +56,7 @@
;(package! org :pin "ca873f7") ;(package! org :pin "ca873f7")
(package! org-books) (package! org-books)
(package! org-download)
;;; customized to support repeated tasks, see https://github.com/akhramov/org-wild-notifier.el/issues/41 ;;; customized to support repeated tasks, see https://github.com/akhramov/org-wild-notifier.el/issues/41
(package! org-wild-notifier (package! org-wild-notifier

View File

@ -0,0 +1,10 @@
#!/bin/sh
wl-paste -t image > /tmp/convert-paste-png.data
#convert /tmp/convert-paste-png.data -format png "$1"
case "$(file --dereference --brief --mime-type -- "/tmp/convert-paste-png.data")" in
image/jpg|image/jpeg) convert /tmp/convert-paste-png.data -format png "$1" ;;
image/png) wl-paste -t image/png > "$1" ;;
esac