Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
org-mode open gif image link with image-animate
(setq org-file-apps
'(;; Web Pages
("\.x?html?\\'" . "firefox %s")
;; PDF (disable this because I use package `org-pdfview'.
;; ("\\.pdf\\'" . auto-mode)
;; ("\\.pdf::\\([[:digit:]]+\\)\\'" . auto-mode)
;; disable this, to use `doc-view' from `pdf-tools' for PDF.
;; ("\\.pdf\\'" . "okular %s")
;; ("\\.pdf::\\([[:digit:]]+\\)\\'" . "okular -p %1 %s")
;; CHM
("\\.chm\\'" . "kchmviewer %s")
;; EBooks
("\\.epub\\'" . "okular %s")
("\\.mobi\\'" . "okular %s")
("\\.azw3\\'" . "okular %s")
;; Image
("\\.png\\'" . "sxiv %s")
;; ("\\.jp\(e\)?g" . "sxiv %s")
("\\.jpg\\'" . "sxiv %s")
("\\.jpeg\\'" . "sxiv %s")
("\\.gif\\'" . (lambda (file link)
(let (image-var (create-image file))
(with-temp-buffer-window
"*Org-mode animated gif image*"
(progn
(insert-image my-image)
;; (image-animate my-image 0 t)
)
(delete-window nil)
))))
;; ("\\.gif\\'" . "sxiv -a -f %s") ; "sxiv -a -f -- %s
;; ("\\.gif\\'" . "gwenview %s")
;; ("\\.svg\\'" . "feh --magick-timeout 5 %s")
("\\.svg\\'" . "nomacs %s")
;; Mind Maps
("\\.mm\\'" . "freemind %s") ; freeplane
;; Office
;; Open Text Document
("\\.odt\\'" . "libreoffice %s") ; Text Documentation
("\\.ods\\'" . "libreoffice %s") ; Spreadsheet
("\\.odp\\'" . "libreoffice %s") ; Presentation
("\\.odf\\'" . "libreoffice %s") ; Database / Formula
;; Video
("\\.mp4\\'" . "mpv %s")
("\\.mov\\'" . "mpv %s")
("\\.ogv\\'" . "mpv %s")
;; Audio
("\\.mp3\\'" . "mpg123 %s")
("\\.ogg\\'" . "mpv %s")
(auto-mode . emacs)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.