wtf
This commit is contained in:
parent
532df947a8
commit
923946822d
|
@ -1015,45 +1015,48 @@ GNU patch review metho dor sometihng idk
|
||||||
(setq mu4e-maildir "~/Mail")
|
(setq mu4e-maildir "~/Mail")
|
||||||
|
|
||||||
(setq outlook-mail-address
|
(setq outlook-mail-address
|
||||||
(string-trim (shell-command-to-string "pass mail | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")))
|
(string-trim (shell-command-to-string "pass mail | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")))
|
||||||
|
|
||||||
(defun make-proton-from-pass ()
|
(defvar proton-mail-address nil)
|
||||||
"Proton"
|
|
||||||
(let* ((command pass "pass 'Proton Account' | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")
|
(defun get-proton-mail-address-from-pass (command)
|
||||||
(output (shell-command-to-string command))
|
"Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting."
|
||||||
(result (concat output "@proton.me")))
|
(let ((output (shell-command-to-string command)))
|
||||||
result))
|
;; Trim whitespace from the output
|
||||||
|
(setq output (string-trim output))
|
||||||
|
;; Concatenate 'hello' with the command output
|
||||||
|
(setq my-greeting (concat "@proton.me" output))))
|
||||||
|
|
||||||
|
(get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'")
|
||||||
|
|
||||||
(setq proton-mail-address (make-proton-from-pass))
|
|
||||||
|
|
||||||
(setq mu4e-contexts
|
(setq mu4e-contexts
|
||||||
(list
|
(list
|
||||||
;; outlook
|
;; outlook
|
||||||
(make-mu4e-context
|
(make-mu4e-context
|
||||||
:name "Outlook"
|
:name "Outlook"
|
||||||
:match-func
|
:match-func
|
||||||
(lambda (msg)
|
(lambda (msg)
|
||||||
(when msg
|
(when msg
|
||||||
(string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
|
(string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
|
||||||
:vars `((user-mail-address . ,outlook-mail-address)
|
:vars `((user-mail-address . ,outlook-mail-address)
|
||||||
(user-full-name . "Sako")
|
(user-full-name . "Sako")
|
||||||
(mu4e-drafts-folder . "/Outlook/Drafts")
|
(mu4e-drafts-folder . "/Outlook/Drafts")
|
||||||
(mu4e-sent-folder . "/Outlook/Sent")
|
(mu4e-sent-folder . "/Outlook/Sent")
|
||||||
(mu4e-refile-folder . "/Outlook/Inbox")
|
(mu4e-refile-folder . "/Outlook/Inbox")
|
||||||
(mu4e-trash-folder . "/Outlook/Deleted")))
|
(mu4e-trash-folder . "/Outlook/Deleted")))
|
||||||
(make-mu4e-context
|
(make-mu4e-context
|
||||||
:name "Proton"
|
:name "Proton"
|
||||||
:match-func
|
:match-func
|
||||||
(lambda (msg)
|
(lambda (msg)
|
||||||
(when msg
|
(when msg
|
||||||
(string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
|
(string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
|
||||||
:vars `((user-mail-address . ,proton-mail-address)
|
:vars `((user-mail-address . ,proton-mail-address)
|
||||||
(user-full-name . "Sako")
|
(user-full-name . "Sako")
|
||||||
(mu4e-drafts-folder . "/Proton/Drafts")
|
(mu4e-drafts-folder . "/Proton/Drafts")
|
||||||
(mu4e-sent-folder . "/Proton/Sent")
|
(mu4e-sent-folder . "/Proton/Sent")
|
||||||
(mu4e-refile-folder . "/Proton/Inbox")
|
(mu4e-refile-folder . "/Proton/Inbox")
|
||||||
(mu4e-trash-folder . "/Proton/Trash")))
|
(mu4e-trash-folder . "/Proton/Trash")))
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
* Org
|
* Org
|
||||||
|
|
Loading…
Reference in a new issue