diff --git a/config-ext.org b/config-ext.org index d639b25..71d6b58 100644 --- a/config-ext.org +++ b/config-ext.org @@ -264,7 +264,7 @@ (interactive) (find-file (notmuch-show-get-filename)))) - (use-package exwm + (use-exwm :config (defvar offlineimap-timer nil) (defvar offlineimap-process nil) @@ -871,7 +871,7 @@ (exwm-global-set-key (kbd "s-s") #'toggle-audio-output) - (use-package exwm + (use-exwm :config (add-hook 'exwm-init-hook #'setup-headphone-stuff)) #+end_src diff --git a/config-exwm.org b/config-exwm.org index 49e8fe2..019300a 100644 --- a/config-exwm.org +++ b/config-exwm.org @@ -4,7 +4,7 @@ #+begin_src emacs-lisp ;; This will be the hardest to write :/ (when my/enable-exwm - (use-package exwm + (use-exwm :load-path "~/.emacs.d/submodule/exwm/" :config (use-package exwm-x) diff --git a/config-org.org b/config-org.org index 3bb7545..785b8f7 100644 --- a/config-org.org +++ b/config-org.org @@ -564,7 +564,7 @@ ;; #'dont-copy-faces-for-x-show-tip)) ) - (use-package exwm + (use-exwm :config (setq org-noter-always-create-frame nil)) #+end_src diff --git a/init.el b/init.el index 0fe39e6..005baa4 100644 --- a/init.el +++ b/init.el @@ -1,7 +1,7 @@ (add-to-list 'default-frame-alist '(width . 200)) (add-to-list 'default-frame-alist '(height . 60)) -(setq package-list '(org use-package exwm)) +(setq package-list '(org use-package)) ;; list the repositories containing them (setq package-archives '(("melpa" . "http://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/") @@ -63,6 +63,8 @@ 'face-new-frame-defaults 'face--new-frame-defaults "28.1")) +(ec/load-or-ask-pred 'my/load-full-config "Do you want to load full config for emacs?") + ;; It is imperative that this be loaded for a nice emacs ;; experience. Only SUPER stable stuff goes in this file, and should ;; rarely be modified @@ -70,28 +72,32 @@ (expand-file-name "config-min.org" user-emacs-directory)) -;; Load additional exwm stuff that changes constantly -(when my/enable-exwm - (use-package exwm - :config - (org-babel-load-file - (expand-file-name "config-exwm.org" - user-emacs-directory)))) +(when my/load-full-config -(org-babel-load-file - (expand-file-name "config-ext.org" - user-emacs-directory)) + ;; Load additional exwm stuff that changes constantly + (use-exwm + :config + (org-babel-load-file + (expand-file-name "config-exwm.org" + user-emacs-directory))) -;; Load work stuff when at work. -(if my/at-ti - (require 'work-config) (org-babel-load-file - (expand-file-name "config-org.org" - user-emacs-directory))) + (expand-file-name "config-ext.org" + user-emacs-directory)) -(org-babel-load-file - (expand-file-name "my-redefs.org" - user-emacs-directory)) + ;; Load work stuff when at work. + (if my/at-ti + (require 'work-config) + (org-babel-load-file + (expand-file-name "config-org.org" + user-emacs-directory))) + + (org-babel-load-file + (expand-file-name "my-redefs.org" + user-emacs-directory)) + + (when my/enable-exwm + (require 'exwm))) (setq my/finished t) ;; Testing pull from windows diff --git a/lisp/keymap.el b/lisp/keymap.el index 27e1c1c..b41d527 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -1,9 +1,10 @@ (defmacro exwm-global-set-key (keybinding function) `(progn - (use-package exwm + (use-exwm :config - (add-to-list 'exwm-input-global-keys - (cons ,keybinding ,function))) + (with-eval-after-load "exwm" + (add-to-list 'exwm-input-global-keys + (cons ,keybinding ,function)))) (global-set-key ,keybinding ,function))) (exwm-global-set-key (kbd "M-T") 'flop-frame) @@ -17,9 +18,10 @@ 'my/keymap-key-key "What would you like *root-map* to be bound to?") -(use-package exwm +(use-exwm :config - (add-to-list 'exwm-input-prefix-keys my/keymap-key-key)) + (with-eval-after-load "exwm" + (add-to-list 'exwm-input-prefix-keys my/keymap-key-key))) ;; Disable C-t for all others (with-eval-after-load "dired" diff --git a/lisp/libs.el b/lisp/libs.el index bfd9cb9..ad0b5c0 100644 --- a/lisp/libs.el +++ b/lisp/libs.el @@ -11,4 +11,7 @@ (require 'cl) (require 'subr-x) +;; This is helpful, for exwm-related loading +(require 'use-exwm) + (provide 'libs) diff --git a/lisp/org-process.el b/lisp/org-process.el index 4d5f9ab..762f9e5 100644 --- a/lisp/org-process.el +++ b/lisp/org-process.el @@ -172,7 +172,7 @@ (op/refile-to-point (buffer-file-name) location))))))) -(use-package exwm +(use-exwm :config (require 'fireorg) diff --git a/lisp/use-exwm.el b/lisp/use-exwm.el new file mode 100644 index 0000000..79ddd04 --- /dev/null +++ b/lisp/use-exwm.el @@ -0,0 +1,38 @@ +;;; use-exwm.el --- -*- lexical-binding: t -*- + +;; Copyright (C) 2021 Benson Chu + +;; Author: Benson Chu +;; Created: [2021-08-15 12:55] + +;; This file is not part of GNU Emacs + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Handling loading of exwm will be handled by init.el. This macro is +;; used so I don't accidentally forget to :defer exwm. This way, every +;; :config block is automatically wrapped in an eval-after-load block. + +;;; Code: + +(defmacro use-exwm (&rest body) + `(use-package exwm + :load-path "~/.emacs.d/submodule/exwm" + :defer t + ,@body)) + +(provide 'use-exwm) +;;; use-exwm.el ends here