Only load exwm at the end of the config

Also improved debug interface for Emacs. Rerun the "load full config"
prompt in order to jump into minimal emacs next boot.
This commit is contained in:
Benson Chu 2021-08-15 12:58:40 -05:00
parent e842ba6c79
commit 9a2dccbc13
8 changed files with 78 additions and 29 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

24
init.el
View file

@ -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,29 +72,33 @@
(expand-file-name "config-min.org"
user-emacs-directory))
;; Load additional exwm stuff that changes constantly
(when my/enable-exwm
(use-package exwm
(when my/load-full-config
;; Load additional exwm stuff that changes constantly
(use-exwm
:config
(org-babel-load-file
(expand-file-name "config-exwm.org"
user-emacs-directory))))
user-emacs-directory)))
(org-babel-load-file
(org-babel-load-file
(expand-file-name "config-ext.org"
user-emacs-directory))
;; Load work stuff when at work.
(if my/at-ti
;; 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
(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

View file

@ -1,9 +1,10 @@
(defmacro exwm-global-set-key (keybinding function)
`(progn
(use-package exwm
(use-exwm
:config
(with-eval-after-load "exwm"
(add-to-list 'exwm-input-global-keys
(cons ,keybinding ,function)))
(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"

View file

@ -11,4 +11,7 @@
(require 'cl)
(require 'subr-x)
;; This is helpful, for exwm-related loading
(require 'use-exwm)
(provide 'libs)

View file

@ -172,7 +172,7 @@
(op/refile-to-point (buffer-file-name) location)))))))
(use-package exwm
(use-exwm
:config
(require 'fireorg)

38
lisp/use-exwm.el Normal file
View file

@ -0,0 +1,38 @@
;;; use-exwm.el --- -*- lexical-binding: t -*-
;; Copyright (C) 2021 Benson Chu
;; Author: Benson Chu <bensonchu457@gmail.com>
;; 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 <https://www.gnu.org/licenses/>.
;;; 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