#+TITLE: DOOM Emacs Configuration #+STARTUP: indent overview #+PROPERTY: header-args :tangle config.el * Custom settings Store options set via =customize-*= in a separate file (Emacs stores them in =init.el= by default). #+BEGIN_SRC emacs-lisp (setq custom-file "~/.emacs.d/custom.el") (if (file-exists-p custom-file) (load custom-file)) (setf custom-safe-themes t) #+END_SRC * Theme I'm feeling the gruvbox theme lately. #+begin_src emacs-lisp (setq doom-theme 'doom-gruvbox) #+end_src * UX Improvements ** Disable C-z backgrounding when the GUI is loaded In OSX, this minimizes the window. It's incredibly annoying, and I accidentally hit it too much. I also can't think of any reason I'd want to background Emacs outside of a terminal session. #+begin_src emacs-lisp (if (display-graphic-p) (global-unset-key (kbd "C-z"))) #+end_src ** Mixed Pitch Facilitates mixing monospace and proportional fonts. I'm using an MIT-licensed version of the [[https://github.com/edwardtufte/et-book][Edward Tufte book font]] because it's /gorgeous/. #+begin_src emacs-lisp (use-package! mixed-pitch :hook ((org-mode markdown-mode rst-mode) . mixed-pitch-mode)) (setq doom-variable-pitch-font (font-spec :family "ETBookOT" :size 19)) #+end_src ** Comic Sans Mono Why not, it's fun 🤣 https://dtinth.github.io/comic-mono-font/ #+begin_src emacs-lisp (defun my/buffer-face-comic-mono () (interactive) (setq buffer-face-mode-face '(:family "Comic Mono")) (buffer-face-mode)) (after! php-mode (add-hook 'php-mode-hook #'my/buffer-face-comic-mono)) #+end_src ** Frame transparency #+begin_src emacs-lisp (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) (add-to-list 'default-frame-alist '(alpha . (90 . 90))) #+end_src * Counsel ** Linux application launcher #+begin_src emacs-lisp (use-package! counsel :custom (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only) :config (counsel-mode 1)) #+end_src * EXWM #+begin_src sh :tangle ~/.dmrc [Desktop] session=~/.doom.d/start-exwm.sh #+end_src #+begin_src sh :tangle start-exwm.sh :shebang #!/bin/sh emacs -mm --debug-init -l ~/.doom.d/exwm.el #+end_src #+begin_src emacs-lisp :tangle exwm.el (defun my/exwm-update-class () (exwm-workspace-rename-buffer exwm-class-name)) (defun my/run-in-background (command) (let ((command-parts (split-string command "[ ]+"))) (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) (defun my/set-desktop-background () (interactive) (start-process-shell-command "feh" nil "feh --bg-scale ~/Pictures/Wallpapers/1520742811045.png")) (defvar my/polybar-process nil "Holds the process of the running Polybar instance, if any") (defun my/kill-panel () (interactive) (when my/polybar-process (ignore-errors (kill-process my/polybar-process))) (setq my/polybar-process nil)) (defun my/start-panel () (interactive) (my/kill-panel) (setq my/polybar-process (start-process-shell-command "polybar" nil "polybar-git -c ~/.doom.d/polybar.conf panel"))) (defun my/exwm-init-hook () ;; Start on workspace1 (exwm-workspace-switch-create 1) ;; Start polybar (my/start-panel) ;; Start system tray applets (my/run-in-background "nm-applet") (my/run-in-background "pasystray") (my/run-in-background "blueman-applet") (my/run-in-background "nextcloud --background") (my/run-in-background "compton")) (use-package! exwm :config (setq exwm-input-global-keys `(([?\s-r] . exwm-reset) ([?\s-w] . exwm-workspace-switch) ,@(mapcar (lambda (i) `(,(kbd (format "s-%d" i)) . (lambda () (interactive) (exwm-workspace-switch-create ,i)))) (number-sequence 0 9)) ([?\s-&] . (lambda (command) (interactive (list (read-shell-command "$ "))) (start-process-shell-command command nil command))))) (exwm-input-set-key (kbd "s-SPC") #'counsel-linux-app) (add-hook! 'exwm-update-class-hook #'my/exwm-update-class) (add-hook! 'exwm-init-hook #'my/exwm-init-hook) (my/set-desktop-background) (exwm-enable)) (use-package! exwm-config :after exwm) (use-package! desktop-environment :after exwm :config (desktop-environment-mode)) #+end_src * Polybar #+begin_src conf :tangle polybar.conf ; Docs: https://github.com/polybar/polybar ;========================================================== [settings] screenchange-reload = true [global/wm] margin-top = 0 margin-bottom = 0 [colors] background = #f0232635 background-alt = #576075 foreground = #A6Accd foreground-alt = #555 primary = #ffb52a secondary = #e60053 alert = #bd2c40 underline-1 = #c792ea [bar/panel] width = 100% height = 20 offset-x = 0 offset-y = 0 fixed-center = true enable-ipc = true background = ${colors.background} foreground = ${colors.foreground} line-size = 2 line-color = #f00 border-size = 0 border-color = #00000000 padding-top = 5 padding-left = 1 padding-right = 1 module-margin = 1 font-0 = "Cantarell:size=12:weight=bold;2" font-1 = "Font Awesome:size=8;2" font-2 = "Material Icons:size=14;5" font-3 = "Fira Mono:size=7;-3" modules-right = cpu temperature battery date tray-position = right tray-padding = 2 tray-maxsize = 28 cursor-click = pointer cursor-scroll = ns-resize [module/cpu] type = internal/cpu interval = 2 format = 