Helper function and desktop file aimed to automate process of capturing and attaching files from file system directly to the org-mode.
(use-package org-attach-file)
Install desktop file to system:
# Using GNU Stow (https://www.gnu.org/software/stow/)
stow -t ~ var
# .. or linking it by hands
mkdir -p ~/bin
mkdir -p ~/.local/share/kservices5/ServiceMenus/
ln -s $(realpath var/bin/org-attach-file) ~/bin/org-attach-file
ln -s $(realpath var/.local/share/kservices5/ServiceMenus/emacs-file-capture.desktop) \
~/.local/share/kservices5/ServiceMenus/emacs-file-capture.desktop
# Update desktop data base
update-desktop-database ~/.local/share/applications/
This installation process assumes you are working with KDEv5 environment and
that folder ~/bin
is in your $PATH
variable. While the desktop file will
possibly work with other file managers and DEs, the destination folder is
certainly different.
Package recipe:
(package! org-attach-file-capture
:recipe (:repo "mskorzhinskiy/org-attach-file-capture"
:host github :branch "main"))
After installing, you should be able to see “Attach to org-mode” menu when you’ll right-clock file in KDE file managers, like Dolphin. Pressing this button will pop up a frame with capture templates.
- Supports sending multiply files at once (each file gets its own heading and ID);
- Separate variable for file capture templates;
- Capture is always immediately ends after pressing “Attach to org-mode”.
Right click in Dolphin:
Normal capture interface:
Newly created headline: