aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-10 18:33:13 -0500
committerCraig Jennings <c@cjennings.net>2026-06-10 18:33:13 -0500
commit1a25fada34763ed1ab1aa07c22d6305d1dedac2d (patch)
treed3fdd183cac70cbd408322377c4b3f5011c5349a
parente1456f70d079c929ffdaba5ff40a485a8a6f0034 (diff)
downloaddotemacs-1a25fada34763ed1ab1aa07c22d6305d1dedac2d.tar.gz
dotemacs-1a25fada34763ed1ab1aa07c22d6305d1dedac2d.zip
feat(org-capture): auto-close the quick-capture popup frame
A Hyprland keybind (Super+Shift+N) now opens an emacsclient frame named org-capture for one-shot captures. The new after-finalize hook deletes that frame on C-c C-c or C-c C-k, matching the popup-frame pattern; frames with any other name are untouched, so in-Emacs captures behave as before.
-rw-r--r--modules/org-capture-config.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el
index 4987eee8..b4030479 100644
--- a/modules/org-capture-config.el
+++ b/modules/org-capture-config.el
@@ -344,5 +344,19 @@ Captured On: %U" :prepend t)
)) ;; end setq
) ;; end use-package org-protocol
+;; ---------------------- Popup Capture Frame Auto-Close ----------------------
+;; The quick-capture script (Hyprland Super+Shift+N) opens an emacsclient
+;; frame named "org-capture"; Hyprland window rules float and center it by
+;; that name. These hooks close the frame when the capture finalizes or
+;; aborts, so the popup never lingers. Frames not named "org-capture" are
+;; untouched — normal in-Emacs captures keep their windows.
+
+(defun cj/org-capture--delete-popup-frame ()
+ "Delete the current frame when it is the quick-capture popup."
+ (when (equal (frame-parameter nil 'name) "org-capture")
+ (delete-frame)))
+
+(add-hook 'org-capture-after-finalize-hook #'cj/org-capture--delete-popup-frame)
+
(provide 'org-capture-config)
;;; org-capture-config.el ends here.