config/emacs: nvm

This commit is contained in:
Sakooooo 2024-09-24 22:41:16 +04:00
parent b3736f30f3
commit 93d1c75261
Signed by: sako
GPG key ID: FE52FD65B76E4751

View file

@ -1153,120 +1153,101 @@ its over the machines took over guys can i get my likes now
** mu4e ** mu4e
GNU patch review metho dor sometihng idk GNU patch review metho dor sometihng idk
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package mu4e (use-package mu4e
:config :config
;; mu4e syncing issue with isync ;; mu4e syncing issue with isync
(setq mu4e-change-filenames-when-moving t) (setq mu4e-change-filenames-when-moving t)
;; sending mail ;; sending mail
(setq message-send-mail-function 'smtpmail-send-it) (setq message-send-mail-function 'smtpmail-send-it)
(setq mu4e-update-interval (* 10 60)) (setq mu4e-update-interval (* 10 60))
(setq mu4e-get-mail-command "offlineimap") (setq mu4e-get-mail-command "offlineimap")
(setq mu4e-maildir "~/Mail") (setq mu4e-maildir "~/Mail")
(setq outlook-mail-address (setq outlook-mail-address
(string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")))
(defvar proton-mail-address nil) (defvar proton-mail-address nil)
(defun get-proton-mail-address-from-pass (command) (defun get-proton-mail-address-from-pass (command)
"Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting."
(let ((output (shell-command-to-string command))) (let ((output (shell-command-to-string command)))
(setq output (string-trim output)) (setq output (string-trim output))
(setq proton-mail-address (concat "@proton.me" output)))) (setq proton-mail-address (concat "@proton.me" output))))
(get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") (get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")
(setq gmail-1-mail-address (setq gmail-1-mail-address
(string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")))
(setq gmail-2-mail-address (setq gmail-2-mail-address
(string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")))
(setq mu4e-context-policy 'pick-first) (setq mu4e-context-policy 'pick-first)
(setq mu4e-compose-context-policy 'always-ask) (setq mu4e-compose-context-policy 'always-ask)
(setq mu4e-contexts (setq mu4e-contexts
(list (list
;; outlook ;; outlook
(make-mu4e-context
:name "Outlook"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . ,outlook-mail-address)
(user-full-name . "Sako")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-refile-folder . "/Outlook/Inbox")
(mu4e-trash-folder . "/Outlook/Deleted")
;; todo stmpmail and compose signatures
))
(make-mu4e-context
:name "Proton"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . ,proton-mail-address)
(user-full-name . "Sako")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-refile-folder . "/Proton/Inbox")
(mu4e-trash-folder . "/Proton/Trash"))
;; todo stmpmail and compose signatures
)
(make-mu4e-context (make-mu4e-context
:name "Outlook" :name "Gmail Personal 1"
:match-func :match-func
(lambda (msg) (lambda (msg)
(when msg (when msg
(string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . ,outlook-mail-address) :vars `((user-mail-address . ,gmail-1-mail-address)
(user-full-name . "Sako") (user-full-name . "Sako")
(mu4e-drafts-folder . "/Outlook/Drafts") (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts")
(mu4e-sent-folder . "/Outlook/Sent") (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail")
(mu4e-refile-folder . "/Outlook/Inbox") (mu4e-refile-folder . "/Gmail-Personal-1/Inbox")
(mu4e-trash-folder . "/Outlook/Deleted") (mu4e-trash-folder . "Gmail-Personal-1/Trash")
;; todo stmpmail and compose signatures ;; todo stmpmail and compose signatures
(mu4e-maildir-shortcuts . ( ))
("/Outlook/Inbox" . ?i)
("/Outlook/Sent" . ?s)
("/Outlook/Drafts" . ?d)
))))
(make-mu4e-context (make-mu4e-context
:name "Proton" :name "Second Personal Gmail"
:match-func :match-func
(lambda (msg) (lambda (msg)
(when msg (when msg
(string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . ,proton-mail-address) :vars `((user-mail-address . ,gmail-2-mail-address)
(user-full-name . "Sako") (user-full-name . "Sako")
(mu4e-drafts-folder . "/Proton/Drafts") (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts")
(mu4e-sent-folder . "/Proton/Sent") (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail")
(mu4e-refile-folder . "/Proton/Inbox") (mu4e-refile-folder . "/Gmail-Personal-2/Inbox")
(mu4e-trash-folder . "/Proton/Trash")) (mu4e-trash-folder . "Gmail-Personal-2/Trash")
;; todo stmpmail and compose signatures ))
(mu4e-maildir-shortcuts . (
("/Proton/Inbox" . ?i)
("/Proton/Sent" . ?s)
("/Proton/Drafts" . ?d)
)
))
(make-mu4e-context
:name "Gmail Personal 1"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . ,gmail-1-mail-address)
(user-full-name . "Sako")
(mu4e-drafts-folder . "/Gmail-Personal-1/Drafts")
(mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail")
(mu4e-refile-folder . "/Gmail-Personal-1/Inbox")
(mu4e-trash-folder . "Gmail-Personal-1/Trash")
;; todo stmpmail and compose signatures
(mu4e-maildir-shortcuts . (
("/Gmail-Personal-1/Inbox" . ?i)
("/Gmail-Personal-1/Sent Mail" . ?s)
("/Gmail-Personal-1/Drafts" . ?d)
)
)))
(make-mu4e-context
:name "Second Personal Gmail"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . ,gmail-2-mail-address)
(user-full-name . "Sako")
(mu4e-drafts-folder . "/Gmail-Personal-2/Drafts")
(mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail")
(mu4e-refile-folder . "/Gmail-Personal-2/Inbox")
(mu4e-trash-folder . "Gmail-Personal-2/Trash")
(mu4e-maildir-shortcuts . (
("/Gmail-Personal-2/Inbox" . ?i)
("/Gmail-Personal-2/Sent Mail" . ?s)
("/Gmail-Personal-2/Drafts" . ?d)
)
)))
)) ))
) )
#+end_src #+end_src
* Org * Org
#+begin_src emacs-lisp #+begin_src emacs-lisp