Customize org-download-screenshot-method when using KDE

Posted on April 4, 2026
Tags:

Table of Contents

  1. Setting org-download
  2. Use bash script to wrap
  3. KDE shortcut setting

Setting org-download

在 Emacs 的 org-download 包中,有一个函数用于截图 org-download-screenshot

;; use spectable on KDE, override doom config: /home/wd/.config/emacs/modules/lang/org/contrib/dragndrop.el
(use-package! org-download
  :defer t
  :after org
  :config
  (when (and (featurep :system 'linux)
             (executable-find "spectacle"))
    (setq org-download-screenshot-method (concat (executable-find "spectacle") " -r -b -o %s"))))

Use bash script to wrap

使用一个脚本去封装 org-download-screenshot 以供调用:

#!/usr/bin/env bash

/home/wd/.nix-profile/bin/emacsclient --eval '(org-download-screenshot)'

KDE shortcut setting

Binding Ctrl-Shift-F to aforementioned script wrapped with bash. img