From b528cd2a170e28980509624910906e42a82b1691 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Sun, 31 Jan 2021 22:21:18 -0500 Subject: [PATCH] Fix literate config --- README.org | 22 ++++++++++++++++++---- config/xinitrc | 2 +- modules/desktop.el | 6 ++++-- modules/writing.el | 3 --- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index 46e4db4..0f81360 100644 --- a/README.org +++ b/README.org @@ -488,7 +488,13 @@ Open a dired buffer with =SPC d=. :header-args: :tangle ~/.local/source/dotfiles/modules/desktop.el :results silent :END: -I use Emacs as a Desktop Environment with the [[https://github.com/ch11ng/exwm][exwm]] package. It allows Emacs to function as a complete tiling window manager for =X11=. +I use Emacs as a Desktop Environment with the [[https://github.com/ch11ng/exwm][exwm]] package. It allows Emacs to function as a complete tiling window manager for =X11=. My workflow includes launching the window manager with =xinitrc=, without the use of a display manager, controlling *everything* within Emacs. + +#+begin_src conf :tangle ~/.local/source/dotfiles/config/xinitrc +exec dbus-launch --exit-with-session emacs -mm --debug-init +#+end_src + +Define a method to run an external process, allowing us to launch any application on a new process without interferring with Emacs. #+begin_src emacs-lisp (defun dotfiles/run (command) @@ -505,10 +511,18 @@ Some methods must be called and applied to the current call process in order to (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) #+end_src +Place keybindings for executing shell commands behind =SPC x=. + ++ Run with =x= ++ Run in backround with =g= ++ Run asynchronously with =z= + #+begin_src emacs-lisp (dotfiles/leader - "x" '(dotfiles/run :which-key "Execute") - "z" '(async-shell-command :which-key "Async")) + "x" '(:ignore t :which-key "Execute") + "xx" '(dotfiles/run :which-key "Run") + "xb" '(dotfiles/run-in-background :which-key "Run (background)") + "xz" '(async-shell-command :which-key "Async")) #+end_src When the window manager first launches the ~init-hook~ will be called, this allows us to define some custom logic when it's initialized. @@ -614,7 +628,7 @@ SyncState * The system typically expects to find this file at ~$HOME/.mbsyncrc~, but you may also specify a custom path if launching the command using arguments. I chose to symlink the default location to my repository. -#+begin_src shell +#+begin_src shell :tangle no mbsync -a mu index --maildir="~/.cache/mail" #+end_src diff --git a/config/xinitrc b/config/xinitrc index 322bf3e..180d14c 100644 --- a/config/xinitrc +++ b/config/xinitrc @@ -1 +1 @@ -exec dbus-launch --exit-with-session emacs -mm --debug-init \ No newline at end of file +exec dbus-launch --exit-with-session emacs -mm --debug-init diff --git a/modules/desktop.el b/modules/desktop.el index e06066c..184a5b6 100644 --- a/modules/desktop.el +++ b/modules/desktop.el @@ -8,8 +8,10 @@ (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) (dotfiles/leader - "x" '(dotfiles/run :which-key "Execute") - "z" '(async-shell-command :which-key "Async")) + "x" '(:ignore t :which-key "Execute") + "xx" '(dotfiles/run :which-key "Run") + "xb" '(dotfiles/run-in-background :which-key "Run (background)") + "xz" '(async-shell-command :which-key "Async")) (defun dotfiles/init-hook () (exwm-workspace-switch-create 1) diff --git a/modules/writing.el b/modules/writing.el index 8cee34e..160f76e 100644 --- a/modules/writing.el +++ b/modules/writing.el @@ -185,6 +185,3 @@ "%?" :file-name "slides/${slug}" :head "#+TITLE: ${title}\n")) - -mbsync -a -mu index --maildir="~/.cache/mail"