I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.9 KiB

4 years ago
  1. (use-package mu4e
  2. :load-path "/usr/share/emacs/site-lisp/mu4e"
  3. :custom (mu4e-maildir "~/.cache/mail")
  4. (mu4e-update-interval (* 5 60))
  5. (mu4e-get-mail-command "mbsync -a")
  6. (mu4e-compose-format-flowed t)
  7. (mu4e-change-filenames-when-moving t)
  8. (message-send-mail-function 'smtpmail-send-it)
  9. (mml-secure-openpgp-signers '("37AB1CB72B741E478CA026D43025DCBD46F81C0F"))
  10. (mu4e-compose-signature (concat "Chris Hayward\n"
  11. "https://chrishayward.xyz\n"))
  12. :config
  13. (add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
  14. (setq mu4e-contexts
  15. (list
  16. ;; Main
  17. ;; chris@chrishayward.xyz
  18. (make-mu4e-context
  19. :name "Main"
  20. :match-func
  21. (lambda (msg)
  22. (when msg
  23. (string-prefix-p "/Main" (mu4e-message-field msg :maildir))))
  24. :vars
  25. '((user-full-name . "Christopher James Hayward")
  26. (user-mail-address . "chris@chrishayward.xyz")
  27. (smtpmail-smtp-server . "mail.chrishayward.xyz")
  28. (smtpmail-smtp-service . 587)
  29. (smtpmail-stream-type . starttls))))))
  30. (use-package mu4e-alert
  31. :custom (mu4e-alert-set-default-style 'libnotify)
  32. :config (mu4e-alert-enable-notifications)
  33. (mu4e-alert-enable-mode-line-display))
  34. (dotfiles/leader
  35. "m" '(mu4e :which-key "Mail"))
  36. (setenv "BROWSER" dotfiles/browser)
  37. ;; (dotfiles/leader
  38. ;; "b" '(dotfiles/run-in-background dotfiles/browser :which-key "Browser"))
  39. (defun dotfiles/run (command)
  40. "Run an external process."
  41. (interactive (list (read-shell-command "λ ")))
  42. (start-process-shell-command command nil command))
  43. (defun dotfiles/run-in-background (command)
  44. (let ((command-parts (split-string command "[ ]+")))
  45. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  46. (dotfiles/leader
  47. "x" '(dotfiles/run :which-key "Run")
  48. "z" '(async-shell-command :which-key "Async"))
  49. (defun dotfiles/init-hook ()
  50. (exwm-workspace-switch-create 1)
  51. (setq display-time-and-date t)
  52. (display-battery-mode 1)
  53. (display-time-mode 1))
  54. (defun dotfiles/update-display ()
  55. (dotfiles/run-in-background "autorandr --change --force"))
  56. (use-package exwm
  57. :custom (exwm-input-prefix-keys
  58. '(?\M-x
  59. ?\C-g
  60. ?\C-\ ))
  61. (exwm-input-global-keys
  62. `(([?\s-r] . exwm-reset)
  63. ,@(mapcar (lambda (i)
  64. `(,(kbd (format "s-%d" i)) .
  65. (lambda ()
  66. (interactive)
  67. (exwm-workspace-switch-create ,i))))
  68. (number-sequence 1 9))))
  69. :config (require 'exwm-randr)
  70. (exwm-randr-enable)
  71. (add-hook 'exwm-init-hook #'dotfiles/init-hook)
  72. (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display)
  73. (dotfiles/update-display)
  74. (exwm-enable))