From c4acff47217ddab392262789a6915ae5eb4cee61 Mon Sep 17 00:00:00 2001 From: nathan mccarty Date: Tue, 5 Jul 2022 01:07:47 -0400 Subject: [PATCH] Emacs tweaks - Setup mu4e bookmarks how I like them - Configure Alert - Cleanup TODOs - Setup anki-editor --- doom.d/config.el | 25 +++++++++++++++++--- doom.d/config.org | 33 ++++++++++++++++++++++++--- doom.d/init.el | 4 ++-- doom.d/packages.el | 2 ++ home-manager/programs/devel.nix | 3 --- home-manager/programs/emacs.nix | 21 ++++++++++++++++- home-manager/services/email.nix | 1 - machines/levitation/configuration.nix | 2 -- modules/desktop.nix | 2 +- 9 files changed, 77 insertions(+), 16 deletions(-) diff --git a/doom.d/config.el b/doom.d/config.el index b66f3c3..729cef4 100644 --- a/doom.d/config.el +++ b/doom.d/config.el @@ -108,6 +108,11 @@ (after! treemacs (setq treemacs-width 25)) +(use-package! alert + :config + ;; TODO: Make this conditional so we can make the correct choice on macos + (setq alert-default-style 'libnotify)) + (setq-default fill-column 100) (after! avy @@ -261,6 +266,8 @@ work if it thinks it needs to." "* %a :website:\n\n%U %?\n\n%:initial") org-capture-templates)) +(use-package! anki-editor) + (use-package! magit-todos :hook (magit-mode . magit-todos-mode)) @@ -347,15 +354,27 @@ work if it thinks it needs to." (mu4e-trash-folder . "/nathan@mccarty.io/Trash") (mu4e-refile-folder . "/nathan@mccarty.io/Archive") (smtpmail-smtp-user . "nathan@mccarty.io")) - t) + t)) + +(after! mu4e + (setq mu4e-bookmarks '()) + (add-to-list 'mu4e-bookmarks + '(:name "All Mail" + :key ?a + :query "NOT flag:trashed")) (add-to-list 'mu4e-bookmarks '(:name "Inbox - nathan@mccarty.io" :key ?m - :query "maildir:\"/nathan@mccarty.io/Inbox\" AND NOT flag:trashed"))) + :query "maildir:\"/nathan@mccarty.io/Inbox\" AND NOT flag:trashed")) + (add-to-list 'mu4e-bookmarks + '(:name "Unread" + :key ?u + :query "flag:unread AND NOT flag:trashed"))) (after! mu4e (mu4e-alert-enable-mode-line-display)) (setq +mu4e-backend nil) (after! mu4e - mu4e-get-mail-command "true") + (setq mu4e-get-mail-command "true" + mu4e-update-interval 300)) diff --git a/doom.d/config.org b/doom.d/config.org index a7980f9..fa249d0 100644 --- a/doom.d/config.org +++ b/doom.d/config.org @@ -142,6 +142,14 @@ Configure treemacs, doing the following: (after! treemacs (setq treemacs-width 25)) #+end_src +** Alert +Configure notifications that originate from within emacs +#+begin_src emacs-lisp +(use-package! alert + :config + ;; TODO: Make this conditional so we can make the correct choice on macos + (setq alert-default-style 'libnotify)) +#+end_src * Basic Editing ** Fill Column Set the default fill column to 100 @@ -370,6 +378,11 @@ The default template for org-protocol-capture-html "* %a :website:\n\n%U %?\n\n%:initial") org-capture-templates)) #+end_src +** anki-editor +Flash cards from within emacs. +#+begin_src emacs-lisp +(use-package! anki-editor) +#+end_src * General Modes ** Magit Further configuration for magit @@ -552,11 +565,24 @@ Tell it where our account's stuff is (mu4e-trash-folder . "/nathan@mccarty.io/Trash") (mu4e-refile-folder . "/nathan@mccarty.io/Archive") (smtpmail-smtp-user . "nathan@mccarty.io")) - t) + t)) +#+end_src +Setup our bookmarks, resetting the list of bookmarks first so we can go completely custom +#+begin_src emacs-lisp +(after! mu4e + (setq mu4e-bookmarks '()) + (add-to-list 'mu4e-bookmarks + '(:name "All Mail" + :key ?a + :query "NOT flag:trashed")) (add-to-list 'mu4e-bookmarks '(:name "Inbox - nathan@mccarty.io" :key ?m - :query "maildir:\"/nathan@mccarty.io/Inbox\" AND NOT flag:trashed"))) + :query "maildir:\"/nathan@mccarty.io/Inbox\" AND NOT flag:trashed")) + (add-to-list 'mu4e-bookmarks + '(:name "Unread" + :key ?u + :query "flag:unread AND NOT flag:trashed"))) #+end_src Tell it to enable the modeline display #+begin_src emacs-lisp @@ -567,5 +593,6 @@ Tell it not to update the mail itself, we have a systemd unit for that #+begin_src emacs-lisp (setq +mu4e-backend nil) (after! mu4e - mu4e-get-mail-command "true") + (setq mu4e-get-mail-command "true" + mu4e-update-interval 300)) #+end_src diff --git a/doom.d/init.el b/doom.d/init.el index 47020ee..354de39 100644 --- a/doom.d/init.el +++ b/doom.d/init.el @@ -22,7 +22,7 @@ doom ; what makes DOOM look the way it does doom-dashboard ; a nifty splash screen for Emacs (emoji +unicode +github) ; 🙂 - hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + hl-todo ; highlight todo-words indent-guides ; highlighted indent columns ;;(ligatures +fira) ; ligatures and symbols to make your code pretty again modeline ; snazzy, Atom-inspired modeline, plus API @@ -60,7 +60,7 @@ (spell +flyspell +hunspell +everywhere) ; tasing you for misspelling mispelling :tools - (debugger +lsp) ; FIXME stepping through code, to help you add bugs + (debugger +lsp) ; stepping through code, to help you add bugs direnv docker editorconfig ; let someone else argue about tabs vs spaces diff --git a/doom.d/packages.el b/doom.d/packages.el index 84d3d3e..3a6b257 100644 --- a/doom.d/packages.el +++ b/doom.d/packages.el @@ -62,3 +62,5 @@ (package! grip-mode) (package! org-protocol-capture-html) (package! org-superstar) +(package! alert) +(package! anki-editor) diff --git a/home-manager/programs/devel.nix b/home-manager/programs/devel.nix index a1271df..cc6cc85 100644 --- a/home-manager/programs/devel.nix +++ b/home-manager/programs/devel.nix @@ -103,6 +103,3 @@ with lib; with nLib; { }) ]; } - - -# TODO: Add pyright and python3Full under python module diff --git a/home-manager/programs/emacs.nix b/home-manager/programs/emacs.nix index 71aaed3..33b7093 100644 --- a/home-manager/programs/emacs.nix +++ b/home-manager/programs/emacs.nix @@ -13,6 +13,10 @@ sqlite # For latex editing texlive.combined.scheme-medium + # For notifications + libnotify + # For flash cards + anki ]; # Setup doom emacs programs.doom-emacs = { @@ -24,7 +28,7 @@ pname = "org-protocol-capture-html"; ename = "org-protocol-capture-html"; version = "0.0.0"; - buildInputs = [ self.s ]; + packageRequires = [ self.s ]; src = pkgs.fetchFromGitHub { owner = "alphapapa"; repo = "org-protocol-capture-html"; @@ -32,6 +36,21 @@ hash = "sha256-ueEHJCS+aHYCnd4Lm3NKgqg+m921nl5XijE9ZnSRQXI="; }; }; + anki-editor = self.trivialBuild { + pname = "anki-editor"; + ename = "anki-editor"; + version = "0.3.1"; + packageRequires = with self; [ + dash + request + ]; + src = pkgs.fetchFromGitHub { + owner = "billop"; + repo = "anki-editor"; + rev = "c11187a79a980a738af608c98f8de2cdc1d988be"; + hash = "sha256-3R9bEu982a9Tq+hXy+ALFF/N2NwK9MsqDELFVGHV09I="; + }; + }; }; extraPackages = [ pkgs.mu ]; }; diff --git a/home-manager/services/email.nix b/home-manager/services/email.nix index 09bb627..8387ca4 100644 --- a/home-manager/services/email.nix +++ b/home-manager/services/email.nix @@ -35,7 +35,6 @@ with lib; { primary = true; realName = "Nathan McCarty"; userName = "nathan@mccarty.io"; - # TODO: Move into `pass` passwordCommand = "${pkgs.pass}/bin/pass protonmail-bridge-password"; aliases = [ "thatonelutenist@protonmail.com" diff --git a/machines/levitation/configuration.nix b/machines/levitation/configuration.nix index 90ae49f..a1bf065 100644 --- a/machines/levitation/configuration.nix +++ b/machines/levitation/configuration.nix @@ -55,13 +55,11 @@ interfaces.enp6s0.useDHCP = true; nat.externalInterface = "enp6s0"; # Open ports for soulseek - # TODO add in soulseek firewall = { allowedTCPPorts = [ 61377 ]; allowedUDPPorts = [ 61377 ]; }; }; - # FIXME borg backup module # Setup home manager home-manager.users.nathan = import ./home.nix; diff --git a/modules/desktop.nix b/modules/desktop.nix index 8375856..9cbf1cc 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -64,7 +64,7 @@ with lib; { ]; # Add noisetorch for microphone noise canceling programs.noisetorch = { - enable = true; # TODO: https://github.com/noisetorch/NoiseTorch/releases/tag/0.11.6 + enable = true; }; # Configure fonts })