Skip to content

Instantly share code, notes, and snippets.

Created February 12, 2018 21:17
Show Gist options
  • Save anonymous/093d0def381139b8d7d07eb4d3f59e61 to your computer and use it in GitHub Desktop.
Save anonymous/093d0def381139b8d7d07eb4d3f59e61 to your computer and use it in GitHub Desktop.
org-capture in Firefox EXWM buffers
(defun elmord-exwm-get-firefox-url ()
(exwm-input--fake-key ?\C-l)
(sleep-for 0.1) ;; Wish I could get rid of the sleeps...
(exwm-input--fake-key ?\C-c)
(sleep-for 0.1)
(gui-backend-get-selection 'CLIPBOARD 'STRING))
(defun elmord-exwm-org-store-link ()
(when (and (equal major-mode 'exwm-mode)
(member exwm-class-name '("Firefox" "Firefox-esr")))
(org-store-link-props
:type "http"
:link (elmord-exwm-get-firefox-url)
:description exwm-title)))
(add-to-list 'org-store-link-functions 'elmord-exwm-org-store-link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment