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.

87 lines
3.0 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. :after mu4e
  32. :custom (mu4e-alert-set-default-style 'libnotify)
  33. :config (mu4e-alert-enable-notifications)
  34. (mu4e-alert-enable-mode-line-display))
  35. (dotfiles/leader
  36. "m" '(mu4e :which-key "Mail"))
  37. (setenv "BROWSER" dotfiles/browser)
  38. ;; (dotfiles/leader
  39. ;; "b" '(dotfiles/run-in-background dotfiles/browser :which-key "Browser"))
  40. (defun dotfiles/run (command)
  41. "Run an external process."
  42. (interactive (list (read-shell-command "λ ")))
  43. (start-process-shell-command command nil command))
  44. (defun dotfiles/run-in-background (command)
  45. (let ((command-parts (split-string command "[ ]+")))
  46. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  47. (dotfiles/leader
  48. "x" '(:ignore t :which-key "Run")
  49. "xx" '(dotfiles/run :which-key "Run")
  50. "xz" '(async-shell-command :which-key "Async"))
  51. (defun dotfiles/init-hook ()
  52. (exwm-workspace-switch-create 1)
  53. (setq display-time-and-date t)
  54. (display-battery-mode 1)
  55. (display-time-mode 1))
  56. (defun dotfiles/update-display ()
  57. (dotfiles/run-in-background "autorandr --change --force"))
  58. (use-package exwm
  59. :demand t
  60. :custom (exwm-input-prefix-keys
  61. '(?\M-x
  62. ?\C-g
  63. ?\C-\ ))
  64. (exwm-input-global-keys
  65. `(([?\s-r] . exwm-reset)
  66. ,@(mapcar (lambda (i)
  67. `(,(kbd (format "s-%d" i)) .
  68. (lambda ()
  69. (interactive)
  70. (exwm-workspace-switch-create ,i))))
  71. (number-sequence 1 9))))
  72. :config (require 'exwm-randr)
  73. (exwm-randr-enable)
  74. (add-hook 'exwm-init-hook #'dotfiles/init-hook)
  75. (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display)
  76. (dotfiles/update-display)
  77. (exwm-enable))