diff options
Diffstat (limited to 'gui/conf')
| -rw-r--r-- | gui/conf/init.el | 27 | ||||
| -rw-r--r-- | gui/conf/niri.kdl | 4 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gui/conf/init.el b/gui/conf/init.el index 3c2cfb4..af4bd71 100644 --- a/gui/conf/init.el +++ b/gui/conf/init.el @@ -285,6 +285,33 @@ ((org-agenda-overriding-header "Top Priorities"))) (agenda "" nil))))) +(defcustom custom/org-agenda-frame-name "**Agenda**" + "Customize dedicated frame name to launch `org-agenda' in." + :type 'string) + +(defun custom/org-agenda-frame (command) + "Invoke `org-agenda' in a dedicated Emacs frame. + This function is designed to be called from a shell script using `emacsclient'. + If the dedicated frame already exists, we will use it, otherwise we will create a + new frame. + Finally, the dedicated frame will be deleted up after `org-agenda' finalizes." + (interactive '(nil)) + (if (not (equal custom/org-agenda-frame-name (frame-parameter nil 'name))) + (make-frame '((name . custom/org-agenda-frame-name)))) + (select-frame-by-name custom/org-agenda-frame-name) + (delete-other-windows) + (defun org-agenda-quit--clean-up () + "Close the frame after `org-agenda-quit'." + (advice-remove 'org-agenda 'delete-other-windows) + (advice-remove 'org-agenda-quit 'org-agenda-quit--clean-up) + (advice-remove 'org-agenda-Quit 'org-agenda-quit--clean-up) + (select-frame-by-name custom/org-agenda-frame-name) + (delete-frame nil t)) + (advice-add 'org-agenda-quit :after #'org-agenda-quit--clean-up) + (advice-add 'org-agenda-Quit :after #'org-agenda-quit--clean-up) + (advice-add 'org-agenda :after #'delete-other-windows) + (org-agenda nil command)) + (use-package org-fragtog :ensure t :config diff --git a/gui/conf/niri.kdl b/gui/conf/niri.kdl index cfe7d20..f795bcb 100644 --- a/gui/conf/niri.kdl +++ b/gui/conf/niri.kdl @@ -105,6 +105,7 @@ window-rule { window-rule { match title="\\*\\*Capture\\*\\*" + match title="\\*\\*Agenda\\*\\*" open-floating true open-focused true focus-ring { @@ -126,7 +127,10 @@ binds { Mod+Return { spawn "kitty"; } Mod+Shift+Return { spawn "emacsclient" "-c"; } + + Mod+a { spawn "org-show-agenda"; } Mod+numbersign { spawn "org-capture-todo"; } + Mod+Space { spawn "rofi" "-show" "combi"; } Ctrl+Alt+L { spawn "swaylock" "--color" "#000000"; } |
