From 220cfb4d586e5925325a7b605cd9a529ce298b94 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Fri, 7 Jun 2024 14:57:56 +0200 Subject: [PATCH] pinwheel: Open PDFs from `emacs` using `firefox` --- hosts/pinwheel/modules/emacs/config.org | 9 +++++++++ hosts/pinwheel/modules/firefox/default.nix | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hosts/pinwheel/modules/emacs/config.org b/hosts/pinwheel/modules/emacs/config.org index 82f0100..1e8c63c 100644 --- a/hosts/pinwheel/modules/emacs/config.org +++ b/hosts/pinwheel/modules/emacs/config.org @@ -354,6 +354,15 @@ https://github.com/justbur/emacs-which-key (embark-collect-mode . consult-preview-at-point-mode)) #+END_SRC +* Opening files +#+BEGIN_SRC emacs-lisp +;; PDFs visited in Org-mode are opened in firefox (and not in the default choice) +(add-hook 'org-mode-hook + '(lambda () + (delete '("\\.pdf\\'" . default) org-file-apps) + (add-to-list 'org-file-apps '("\\.pdf\\'" . "ff-alex %s")))) +#+END_SRC + * Keybindings Setup prefix for keybindings. #+BEGIN_SRC emacs-lisp diff --git a/hosts/pinwheel/modules/firefox/default.nix b/hosts/pinwheel/modules/firefox/default.nix index 697b2a7..b3553a1 100644 --- a/hosts/pinwheel/modules/firefox/default.nix +++ b/hosts/pinwheel/modules/firefox/default.nix @@ -110,7 +110,7 @@ in }; - home.packages = [ ff ]; + home.packages = [ ff ff-alex ]; }; environment.variables.BROWSER = "${ff-alex}/bin/ff-alex $@";