mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-19 07:05:51 +05:30
Added org-xournalpp with some config tweaks
This commit is contained in:
parent
d2052d35b5
commit
58d3d160f5
17
flake.lock
17
flake.lock
|
@ -837,6 +837,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"org-xournalpp": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1625233179,
|
||||||
|
"narHash": "sha256-c0AYWMkBb7wdl7SWTffjWSXwXbq1PGov2vT8A1pdqpQ=",
|
||||||
|
"owner": "vherrmann",
|
||||||
|
"repo": "org-xournalpp",
|
||||||
|
"rev": "c09bd8b99d36c355d632b85ecbffb3b275802381",
|
||||||
|
"type": "gitlab"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "vherrmann",
|
||||||
|
"repo": "org-xournalpp",
|
||||||
|
"type": "gitlab"
|
||||||
|
}
|
||||||
|
},
|
||||||
"org-yaap": {
|
"org-yaap": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -936,6 +952,7 @@
|
||||||
"org-side-tree": "org-side-tree",
|
"org-side-tree": "org-side-tree",
|
||||||
"org-sliced-images": "org-sliced-images",
|
"org-sliced-images": "org-sliced-images",
|
||||||
"org-timeblock": "org-timeblock",
|
"org-timeblock": "org-timeblock",
|
||||||
|
"org-xournalpp": "org-xournalpp",
|
||||||
"org-yaap": "org-yaap",
|
"org-yaap": "org-yaap",
|
||||||
"phscroll": "phscroll",
|
"phscroll": "phscroll",
|
||||||
"rust-overlay": "rust-overlay",
|
"rust-overlay": "rust-overlay",
|
||||||
|
|
|
@ -218,6 +218,10 @@
|
||||||
url = "github:librephoenix/org-krita";
|
url = "github:librephoenix/org-krita";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
org-xournalpp = {
|
||||||
|
url = "gitlab:vherrmann/org-xournalpp";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
org-sliced-images = {
|
org-sliced-images = {
|
||||||
url = "github:jcfk/org-sliced-images";
|
url = "github:jcfk/org-sliced-images";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
@ -440,6 +440,37 @@ same directory as the org-buffer and insert a link to this file."
|
||||||
(setq org-krita-extract-filename "preview.png")
|
(setq org-krita-extract-filename "preview.png")
|
||||||
(setq org-krita-scale 1)
|
(setq org-krita-scale 1)
|
||||||
|
|
||||||
|
(add-load-path! "~/.emacs.d/org-xournalpp")
|
||||||
|
(require 'org-xournalpp)
|
||||||
|
(add-hook 'org-mode-hook 'org-xournalpp-mode)
|
||||||
|
(setq org-xournalpp-template-getter
|
||||||
|
'(closure
|
||||||
|
(t)
|
||||||
|
nil
|
||||||
|
(file-truename "~/Templates/template.xopp") ; use my own template
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; override width to static 250 for now
|
||||||
|
;; so I don't have massive images in org mode (scrolling not fun)
|
||||||
|
(defun org-xournalpp--create-image (link refresh)
|
||||||
|
"Extract svg/png from given LINK and return image.
|
||||||
|
|
||||||
|
Regenerate the cached inline image, if REFRESH is true.
|
||||||
|
|
||||||
|
If the path from LINK does not exist, nil is returned."
|
||||||
|
(let ((width 250)
|
||||||
|
(xopp-path (f-expand (org-element-property :path link))))
|
||||||
|
(when (f-exists? xopp-path)
|
||||||
|
(if width
|
||||||
|
(create-image (org-xournalpp--get-image xopp-path refresh)
|
||||||
|
org-xournalpp-image-type
|
||||||
|
nil
|
||||||
|
:width width)
|
||||||
|
(create-image (org-xournalpp--get-image xopp-path refresh)
|
||||||
|
org-xournalpp-image-type
|
||||||
|
nil)))))
|
||||||
|
|
||||||
(defun org-copy-link-to-clipboard-at-point ()
|
(defun org-copy-link-to-clipboard-at-point ()
|
||||||
"Copy current link at point into clipboard (useful for images and links)"
|
"Copy current link at point into clipboard (useful for images and links)"
|
||||||
;; Remember to press C-g to kill this foreground process if it hangs!
|
;; Remember to press C-g to kill this foreground process if it hangs!
|
||||||
|
|
|
@ -101,6 +101,10 @@ in
|
||||||
source = "${inputs.org-krita}";
|
source = "${inputs.org-krita}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.file.".emacs.d/org-xournalpp" = {
|
||||||
|
source = "${inputs.org-xournalpp}";
|
||||||
|
};
|
||||||
|
|
||||||
home.file.".emacs.d/org-sliced-images" = {
|
home.file.".emacs.d/org-sliced-images" = {
|
||||||
source = "${inputs.org-sliced-images}";
|
source = "${inputs.org-sliced-images}";
|
||||||
};
|
};
|
||||||
|
|
|
@ -517,6 +517,38 @@ same directory as the org-buffer and insert a link to this file."
|
||||||
(setq org-krita-extract-filename "preview.png")
|
(setq org-krita-extract-filename "preview.png")
|
||||||
(setq org-krita-scale 1)
|
(setq org-krita-scale 1)
|
||||||
|
|
||||||
|
(add-load-path! "~/.emacs.d/org-xournalpp")
|
||||||
|
(require 'org-xournalpp)
|
||||||
|
(add-hook 'org-mode-hook 'org-xournalpp-mode)
|
||||||
|
(setq org-xournalpp-template-getter
|
||||||
|
'(closure
|
||||||
|
(t)
|
||||||
|
nil
|
||||||
|
(file-truename "~/Templates/template.xopp") ; use my own template
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; override width to static 250 for now
|
||||||
|
;; so I don't have massive images in org mode (scrolling not fun)
|
||||||
|
(defun org-xournalpp--create-image (link refresh)
|
||||||
|
"Extract svg/png from given LINK and return image.
|
||||||
|
|
||||||
|
Regenerate the cached inline image, if REFRESH is true.
|
||||||
|
|
||||||
|
If the path from LINK does not exist, nil is returned."
|
||||||
|
(let ((width 250)
|
||||||
|
(xopp-path (f-expand (org-element-property :path link))))
|
||||||
|
(when (f-exists? xopp-path)
|
||||||
|
(if width
|
||||||
|
(create-image (org-xournalpp--get-image xopp-path refresh)
|
||||||
|
org-xournalpp-image-type
|
||||||
|
nil
|
||||||
|
:width width)
|
||||||
|
(create-image (org-xournalpp--get-image xopp-path refresh)
|
||||||
|
org-xournalpp-image-type
|
||||||
|
nil)))))
|
||||||
|
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Copy Links/Files into Clipboard
|
*** Copy Links/Files into Clipboard
|
||||||
#+BEGIN_SRC emacs-lisp :tangle config.el
|
#+BEGIN_SRC emacs-lisp :tangle config.el
|
||||||
|
@ -2089,6 +2121,10 @@ in
|
||||||
source = "${inputs.org-krita}";
|
source = "${inputs.org-krita}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.file.".emacs.d/org-xournalpp" = {
|
||||||
|
source = "${inputs.org-xournalpp}";
|
||||||
|
};
|
||||||
|
|
||||||
home.file.".emacs.d/org-sliced-images" = {
|
home.file.".emacs.d/org-sliced-images" = {
|
||||||
source = "${inputs.org-sliced-images}";
|
source = "${inputs.org-sliced-images}";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue