diff options
| author | Adrian Kummerlaender | 2025-10-26 14:08:18 +0100 |
|---|---|---|
| committer | Adrian Kummerlaender | 2025-10-26 14:08:18 +0100 |
| commit | 69e28944ab4f34eacf428a85c3a75ae442f52b1a (patch) | |
| tree | 78f1cc0887e297508614af2c03028a73d3fbe8a4 | |
| parent | 7b11a3c50d4451840a236626e3b968ae238d5cbf (diff) | |
| download | nixos_home-69e28944ab4f34eacf428a85c3a75ae442f52b1a.tar nixos_home-69e28944ab4f34eacf428a85c3a75ae442f52b1a.tar.gz nixos_home-69e28944ab4f34eacf428a85c3a75ae442f52b1a.tar.bz2 nixos_home-69e28944ab4f34eacf428a85c3a75ae442f52b1a.tar.lz nixos_home-69e28944ab4f34eacf428a85c3a75ae442f52b1a.tar.xz nixos_home-69e28944ab4f34eacf428a85c3a75ae442f52b1a.tar.zst nixos_home-69e28944ab4f34eacf428a85c3a75ae442f52b1a.zip | |
emacs/niri: Add convenient capture shortcutwayland
| -rw-r--r-- | gui/conf/init.el | 21 | ||||
| -rw-r--r-- | gui/conf/niri.kdl | 18 | ||||
| -rw-r--r-- | gui/emacs.nix | 14 | ||||
| -rw-r--r-- | gui/niri.nix | 6 |
4 files changed, 52 insertions, 7 deletions
diff --git a/gui/conf/init.el b/gui/conf/init.el index fc5e344..1c96458 100644 --- a/gui/conf/init.el +++ b/gui/conf/init.el @@ -248,6 +248,27 @@ "* %:description\n%:link %U" :immediate-finish t))) +(defcustom custom/org-capture-frame-name "**Capture**" + :type 'string) + +(defun custom/org-capture-frame (template) + (interactive '(nil)) + (if (not (equal custom/org-capture-frame-name (frame-parameter nil 'name))) + (make-frame '((name . custom/org-capture-frame-name)))) + (select-frame-by-name custom/org-capture-frame-name) + (delete-other-windows) + (defun org-capture-after-finalize-clean-up () + "Clean up after `org-capture' finalizes. + We delete the dedicated frame and removing advice." + (advice-remove 'org-capture-place-template 'delete-other-windows) + (remove-hook 'org-capture-after-finalize-hook 'org-capture-after-finalize-clean-up) + (select-frame-by-name custom/org-capture-frame-name) + (delete-frame nil t)) + (add-hook 'org-capture-mode-hook 'evil-insert-state) + (add-hook 'org-capture-after-finalize-hook 'org-capture-after-finalize-clean-up) + (advice-add #'org-capture-place-template :after 'delete-other-windows) + (org-capture nil template)) + (setq org-agenda-custom-commands '(("p" "Priorities Dashboard" ((tags-todo "+PRIORITY=\"A\"" diff --git a/gui/conf/niri.kdl b/gui/conf/niri.kdl index e09fe68..3e74475 100644 --- a/gui/conf/niri.kdl +++ b/gui/conf/niri.kdl @@ -97,11 +97,26 @@ window-rule { window-rule { match app-id="^blender$" - match app-id="^gimp" + match app-id="^gimp$" default-column-width { proportion 1.0; } } +window-rule { + match title="\\*\\*Capture\\*\\*" + open-floating true + open-focused true + focus-ring { + off + } + shadow { + on + spread 8 + softness 50 + color "#909636" + } +} + binds { Mod+F1 { show-hotkey-overlay; } @@ -110,6 +125,7 @@ binds { Mod+Return { spawn "kitty"; } Mod+Shift+Return { spawn "emacsclient" "-c"; } + Mod+numbersign { spawn "org-capture-todo"; } Mod+Space { spawn "rofi" "-show" "combi"; } Ctrl+Alt+L { spawn "swaylock" "--color" "#000000"; } diff --git a/gui/emacs.nix b/gui/emacs.nix index 92d7ae3..b5b40f6 100644 --- a/gui/emacs.nix +++ b/gui/emacs.nix @@ -89,12 +89,18 @@ ''; }; + org-capture-todo = pkgs.writeScriptBin "org-capture-todo" '' + #!/usr/bin/env bash + emacsclient -c -e '(custom/org-capture-frame "t")' -F '((name . "**Capture**"))' + ''; + in with pkgs; [ symbola (iosevka-bin.override { variant = "Aile"; }) (iosevka-bin.override { variant = "Etoile"; }) mu org-protocol-shortcut + org-capture-todo ]; home.file.".emacs.d/init.el".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dotfiles/home/gui/conf/init.el"; @@ -104,4 +110,12 @@ services.emacs = { enable = true; }; + + xdg.desktopEntries.org-capture-todo = { + name = "Org Capture: TODO"; + comment = "Capture new todo using Emacs org-mode"; + exec = "org-capture-todo"; + terminal = false; + type = "Application"; + }; } diff --git a/gui/niri.nix b/gui/niri.nix index 9cbd41c..62dd099 100644 --- a/gui/niri.nix +++ b/gui/niri.nix @@ -29,12 +29,6 @@ resumeCommand = "${pkgs.niri}/bin/niri-msg 'output * --dpms on'"; } ]; - events = [ - { - event = "before-sleep"; - command = "${pkgs.swaylock}/bin/swaylock -c 000000"; - } - ]; }; programs.waybar = { |
