Commit eee62e415b86

Vincent Demeester <vincent@sbr.pm>
2025-07-30 10:31:21
tools/emacs: add a vde/agenda function to start my agenda frame
and run it at startup, and put it in the right workspace. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent bae8504
Changed files (2)
home
common
desktop
tools
emacs
home/common/desktop/sway/default.nix
@@ -179,6 +179,13 @@ in
             title = "^emacs-float$";
           };
         }
+        {
+          criteria = {
+            app_id = "emacs";
+            title = "^emacs-org-agenda$";
+          };
+          command = "move to workspace 9";
+        }
         {
           command = "inhibit_idle fullscreen";
           criteria.app_id = "mpv";
@@ -255,6 +262,7 @@ in
         { command = "emacs --init-directory=$HOME/src/home/tools/emacs --fg-daemon"; }
         { command = "i3-back"; }
         { command = "firefox"; }
+        { command = "emacsclient --eval '(vde/agenda)'"; }
         { command = "${pkgs.kitty}/bin/kitty --title metask --class metask"; }
       ];
     };
tools/emacs/init.el
@@ -1630,6 +1630,16 @@ Add this function to the `after-save-hook'."
       (set-frame-parameter frame 'delete-before-kill-buffer t)
       (set-window-dedicated-p (selected-window) t))))
 
+(defun vde/agenda ()
+  "Launch a frame with the org-agenda and the `org-todos-file' buffer."
+  (interactive)
+  (let ((frame (make-frame '((name . "emacs-org-agenda")))))
+    (select-frame frame)
+    (org-agenda nil "d")
+    (split-window-horizontally)
+    (other-window 1)
+    (find-file org-todos-file)))
+
 (defun memoize-remote (key cache orig-fn &rest args)
   "Memoize a value if the key is a remote path."
   (if (and key