From 7de477a211265a7c8de3a36ba013ce6ef3ee54d0 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Fri, 20 Sep 2024 17:32:37 -0700 Subject: [PATCH] Add reveal-in-file-browser --- thoom-emacs/modules/thoom-tweaks.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/thoom-emacs/modules/thoom-tweaks.el b/thoom-emacs/modules/thoom-tweaks.el index e0dfb63..283337e 100644 --- a/thoom-emacs/modules/thoom-tweaks.el +++ b/thoom-emacs/modules/thoom-tweaks.el @@ -24,7 +24,8 @@ (delete-other-windows))) (use-package emacs - :bind (("C-o" . nil) + :bind (("C-c o b" . reveal-in-file-browser) + ("C-o" . nil) ("C-o C-o" . other-window) ("C-o o" . other-window) ("C-o b" . consult-buffer-other-window-no-focus) @@ -151,3 +152,13 @@ (use-package explain-pause-mode :ensure (:host github :repo "lastquestion/explain-pause-mode")) + +(defun first-executable (candidates) + (seq-find #'executable-find candidates)) + +;; Reveal in finder/nautilus/whatever +(defun reveal-in-file-browser () + (interactive) + (call-process + (first-executable '("xdg-open" "open")) + nil nil nil "."))