From 1a25fada34763ed1ab1aa07c22d6305d1dedac2d Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 10 Jun 2026 18:33:13 -0500 Subject: 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. --- modules/org-capture-config.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules') 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. -- cgit v1.2.3