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.

86 lines
3.0 KiB

4 years ago
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. (defun dotfiles/run (command)
  39. "Run an external process."
  40. (interactive (list (read-shell-command "λ ")))
  41. (start-process-shell-command command nil command))
  42. (defun dotfiles/run-in-background (command)
  43. (let ((command-parts (split-string command "[ ]+")))
  44. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  45. (dotfiles/leader
  46. "x" '(:ignore t :which-key "Run")
  47. "xx" '(dotfiles/run :which-key "Run")
  48. "xz" '(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. "Update the displays by forcing a change through autorandr."
  56. (dotfiles/run-in-background "autorandr --change --force"))
  57. (use-package exwm
  58. :custom (exwm-workspace-show-all-buffers t)
  59. (exwm-input-prefix-keys
  60. '(?\M-x
  61. ?\C-c
  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))