diff options
Diffstat (limited to '.config/emacs/modules')
| -rw-r--r-- | .config/emacs/modules/bd--browse.el | 46 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--buffer.el | 4 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--chat.el | 118 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--devel.el | 46 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--dictionary.el | 6 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--emms.el | 2 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--exwm.el | 52 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--files.el | 15 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--irc.el | 29 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--minibuffer.el | 2 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--modeline.el | 10 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--notes.el | 5 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--org.el | 16 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--shells.el | 4 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--tabs.el | 26 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--themes.el | 137 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--utility.el | 25 | ||||
| -rw-r--r-- | .config/emacs/modules/bd--window.el | 5 |
18 files changed, 356 insertions, 192 deletions
diff --git a/.config/emacs/modules/bd--browse.el b/.config/emacs/modules/bd--browse.el index c5e409f..7d0b740 100644 --- a/.config/emacs/modules/bd--browse.el +++ b/.config/emacs/modules/bd--browse.el @@ -7,13 +7,13 @@ (require 'fill-column) (defun bd/browse (url &optional pref &rest _) - "Given PREF, launches URL in one of librewolf, torbrowser, -icecat, or eww." + "Given PREF, launches URL in an external browser or eww." (interactive) (pcase pref - (0 (eww url)) - (_ (start-process "librewolf" nil "librewolf" "--new-window" url)))) -(setopt browse-url-browser-function 'bd/browse) + ('eww (eww url)) + ('tor (start-process "torbrowser" nil "torbrowser" "--new-window" url)) + ('chromium (start-process "chromium" nil "chromium" "--new-window" url)) + (_ (start-process "browser" nil (getenv "BROWSER") "--new-window" url)))) (defun bd/selector-bookmarks () "Selector source for all bookmarks." @@ -64,14 +64,19 @@ icecat, or eww." (selector-source-create "Browser" :candidates - (list (bd/search-candidate "SearXNG" "https://searx.operationnull.com/searxng/search?q=" 0) - (bd/search-candidate "Wikipedia" "https://en.wikipedia.org/w/index.php?search=" 0) - (bd/search-candidate "Invidious" "https://inv.nadeko.net/search?q=" 0) - (bd/search-candidate "Urban Dictionary" "https://www.urbandictionary.com/define.php?term=" 0) - (bd/search-candidate "Archwiki" "https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=" 0) + (list (bd/search-candidate "SearXNG" "https://searx.operationnull.com/searxng/search?q=" 'wolf) + (bd/search-candidate "DuckDuckGo" "https://duckduckgo.com/html/?q=" 'eww) + (bd/search-candidate "SearXNG-E" "https://searx.operationnull.com/searxng/search?q=" 'eww) + (bd/search-candidate "Wikipedia" "https://en.wikipedia.org/w/index.php?search=" 'eww) + (bd/search-candidate "Invidious" "https://inv.nadeko.net/search?q=" 'eww) + (bd/search-candidate "Urban Dictionary" "https://www.urbandictionary.com/define.php?term=" 'wolf) + (bd/search-candidate "Nethack Wiki" "https://nethackwiki.com/w/index.php?search=" 'eww) + (bd/search-candidate "Archive of Our Own" "https://archiveofourown.org/works/search?work_search%5Bquery%5D=" 'eww) + (bd/search-candidate "Archwiki" "https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=" 'eww) (bd/selector-rip-video) - (bd/search-candidate "Web" "" 1)))) + (bd/search-candidate "Torbrowser" "" 'tor) + (bd/search-candidate "Librewolf" "" 'wolf)))) (defun bd/browse-dispatcher () "Select and `browse-url' a bookmark or search feature." @@ -99,10 +104,10 @@ icecat, or eww." ("G" . #'elpher-go)) :config (defun bd/elpher (original url &optional new-window) - "Handle gemini links." - (cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url) - (elpher-go url)) - (t (funcall original url new-window)))) + "Handle gemini links." + (cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url) + (elpher-go url)) + (t (funcall original url new-window)))) (advice-add 'eww :around 'bd/elpher) (setopt elpher-default-url-type "gemini" elpher-connection-timeout 120 @@ -114,12 +119,19 @@ icecat, or eww." :bind (:map eww-mode-map ("i" . eww-toggle-images) - ("o" . (lambda () (interactive) (rip-html (eww-current-url))))) + ("o" . (lambda () (interactive) (rip-html (eww-current-url))))) + :hook + ;; eww-mode by default sets this as local var to eww-browse-url + ((eww-mode . + (lambda () + (setq-local browse-url-browser-function #'bd/browse))) + (eww-after-render . eww-readable)) :config (setopt eww-search-prefix "https://searx.operationnull.com/searxng/search?q=" eww-auto-rename-buffer 'title eww-browse-url-new-window-is-tab nil - browse-url-secondary-browser-function #'bd/browse + browse-url-browser-function 'bd/browse + browse-url-secondary-browser-function #'browse-url-default-browser eww-header-line-format nil eww-use-browse-url (regexp-opt '("mailto:" "youtube.com" diff --git a/.config/emacs/modules/bd--buffer.el b/.config/emacs/modules/bd--buffer.el index ea433b0..4a09805 100644 --- a/.config/emacs/modules/bd--buffer.el +++ b/.config/emacs/modules/bd--buffer.el @@ -23,6 +23,10 @@ (setopt clean-buffer-list-delay-special 1800 midnight-period (* 12 3600))) +(use-package atomic-chrome + :config + (atomic-chrome-start-server)) + (provide 'bd--buffer) ;;; bd--buffer.el ends here diff --git a/.config/emacs/modules/bd--chat.el b/.config/emacs/modules/bd--chat.el new file mode 100644 index 0000000..5fa0c2d --- /dev/null +++ b/.config/emacs/modules/bd--chat.el @@ -0,0 +1,118 @@ +;;; -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + + +(require 'fill-column) +(use-package rcirc + :bind (:map rcirc-mode-map + ("C-c j" . #'bd/rcirc-jump-net) + ("C-c q" . #'bd/rcirc-detach-buffer)) + :hook + ((rcirc-mode . (lambda () + (setq-local fill-column-desired-width 80) + (fill-column-mode) + (rcirc-omit-mode)))) + :config + (setopt bd/rcirc-networks '("libera" "furnet")) + (defun bd/rcirc-jump-net () + "Prompts the user for a irc network in BD/RCIRC-NETWORKS, then issues +ZNC to hop networks." + (interactive) + (let ((buffer (current-buffer))) + (when (and (buffer-local-value 'rcirc-server-buffer buffer) + (eq (process-status (rcirc-buffer-process)) 'open)) + (let ((target (completing-read "Jump to: " bd/rcirc-networks))) + (if (stringp target) + (rcirc-send-string (rcirc-buffer-process) + "PRIVMSG" "*status" : + (concat "JUMPNETWORK " target))))))) + (defun bd/rcirc-detach-buffer () + "If the current buffer is an rcirc channel, detaches through ZNC and +deletes the buffer. This bypasses the default behavior of deleting an active +channel, which is issuing the PART command." + (interactive) + (let ((buffer (current-buffer))) + (when (and (rcirc-buffer-process) + (eq (process-status (rcirc-buffer-process)) 'open)) + (with-rcirc-server-buffer + (setq rcirc-buffer-alist + (rassq-delete-all buffer rcirc-buffer-alist))) + (rcirc-update-short-buffer-names) + (if (rcirc-channel-p rcirc-target) + (rcirc-send-string (rcirc-buffer-process) + "PRIVMSG" "*status" : + (concat "DETACH " rcirc-target)))) + (setq rcirc-target nil) + (kill-buffer buffer))) + (setopt rcirc-fill-column 80 + rcirc-omit-threshold 5 + rcirc-reconnect-delay 60 + rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY") + rcirc-track-minor-mode t + rcirc-track-ignore-server-buffer-flag t + rcirc-server-alist + '(("operationnull.com" + :nick "Gondul" + :user-name "Gondul" + :port 6697 + :encryption tls)))) + +(use-package gptel + :bind (("C-c g" . gptel-menu) + ("C-c k" . (lambda () (interactive) (gptel "*evka*") (switch-to-buffer "*evka*")))) + :config + (defvar bd/llama-cpp-buffer-name "*llama-cpp-proc*") + (defvar bd/llama-cpp-reasoning-buffer-name "*llama-cpp-reasoning*") + (defvar bd/llama-cpp-port "4568") + (defvar bd/llama-cpp-threads "8") + (defvar bd/llama-cpp-model-file "Qwen3-8B.Q4_K_M.gguf") + ;; most models seem to ignore this, or llama-cpp doesn't add /no_think like it's supposed to + (defvar bd/llama-cpp-reasoning-budget nil) + (defun bd/gptel-start-backend () + (interactive) + (let ((process (get-buffer-process bd/llama-cpp-buffer-name))) + (if process + (message "llama-cpp process is already running!") + (progn + (start-process-shell-command + "llama-cpp" bd/llama-cpp-buffer-name + (concat "llama-server --reasoning-budget " + (if bd/llama-cpp-reasoning-budget "-1" "0") + " --port " bd/llama-cpp-port + " -t " bd/llama-cpp-threads + " -m " (expand-file-name bd/llama-cpp-model-file "~/.config/guix/assets/")))) + (unless (get-buffer bd/llama-cpp-reasoning-buffer-name) + (generate-new-buffer bd/llama-cpp-reasoning-buffer-name))))) + (defun bd/gptel-stop-backend () + (interactive) + (let ((process (get-buffer-process bd/llama-cpp-buffer-name))) + (if process + (progn + (delete-process process) + (kill-buffer bd/llama-cpp-buffer-name) + (message "Killed %s." process)) + (message "No llama-cpp process is running.")))) + (defun bd/gptel-restart-backend () + (interactive) + (bd/gptel-stop-backend) + (bd/gptel-start-backend)) + + (bd/gptel-start-backend) + + (add-to-list 'gptel-directives + '(evka . "You are a wolf (furry) named Evka hired as a secretary to complete language-based tasks. First describe an action your character does, e.x.: *I tap my claws on the desk*. Finish by responding to the task tersely, in character./no_think")) + + (setopt gptel-model 'qwen-4b + gptel-backend (gptel-make-openai "llama-cpp" + :stream t + :protocol "http" + :host (concat "localhost:" bd/llama-cpp-port) + :models '(qwen-4b)) + gptel-max-tokens 500 + gptel--system-message (alist-get 'evka gptel-directives) + gptel-include-reasoning bd/llama-cpp-reasoning-buffer-name)) + + +(provide 'bd--chat) +;;; bd--chat.el ends here diff --git a/.config/emacs/modules/bd--devel.el b/.config/emacs/modules/bd--devel.el index 2c6ef02..dc68b4b 100644 --- a/.config/emacs/modules/bd--devel.el +++ b/.config/emacs/modules/bd--devel.el @@ -145,32 +145,7 @@ Otherwise, open the repository's main page." (require 'geiser-mode) (require 'geiser-guile) -(defcustom doc-dirs '() - "Defines a buffer-local list of directories to find -documentation." - :type 'list - :group 'docs - :safe 'listp - :local t) - -(defun bd/selector-doc (dir) - "List all HTML files in a directory (recursive), and -display for opening with browser." - (selector-source-create - dir - :candidates - (-map - (lambda (d) (selector-candidate-create (file-relative-name d dir) :value d)) - (directory-files-recursively dir ".html")) - :actions - (list (lambda (x) (eww-open-file x))))) - -(defun bd/doc-finder () - (interactive) - (unwind-protect - (selector - (append (-map (lambda (x) (bd/selector-doc x)) doc-dirs) - (list (bd/selector-search)))))) +(use-package cider) (use-package gdb-mi :config @@ -178,8 +153,6 @@ display for opening with browser." (use-package eglot :defer t - :hook ((c-mode . eglot-ensure) - (c++-mode . eglot-ensure)) :bind (:map eglot-mode-map ("C-c C-f" . eglot-format) ("C-c C-e" . eglot-rename)) @@ -190,12 +163,13 @@ display for opening with browser." (add-to-list 'eglot-server-programs '(c-mode . ("ccls" "--init={\"clang\": {\"extraArgs\": [\"-std=c++20\"]}}")))) -(use-package cc-mode - :hook (((c-mode c++-mode) . (lambda () (setq-local doc-dirs '("~/dc/cppreference")))))) - (use-package rainbow-mode :hook css-mode) +(use-package lua-mode) + +(use-package clojure-mode) + (use-package slime :defer t :commands slime @@ -205,6 +179,11 @@ display for opening with browser." ;; more memory for ml libraries (setopt inferior-lisp-program "sbcl --dynamic-space-size 4096")) +(use-package yasnippet + :hook (vc-git-log-edit-mode . yas-minor-mode) + :config + (add-to-list 'yas-snippet-dirs (expand-file-name "~/pt/guix/etc/snippets/yas"))) + (use-package paren :config (setopt show-paren-delay 0 @@ -214,7 +193,6 @@ display for opening with browser." show-paren-when-point-in-periphery t show-paren-when-point-inside-paren t)) - (use-package rainbow-delimiters :hook prog-mode) @@ -223,6 +201,9 @@ display for opening with browser." emacs-lisp-mode eshell-mode geiser-repl-mode + clojure-mode + cider-repl-mode + lisp-mode scheme-mode slime-repl-mode @@ -234,6 +215,7 @@ display for opening with browser." ('(inferior-emacs-lisp-mode . t) (ielm-return)) ('(eshell-mode . t) (eshell-send-input)) ('(geiser-repl-mode . t) (geiser-repl-maybe-send)) + ('(cider-repl-mode . t) (eshell-send-input)) ('(slime-repl-mode . t) (slime-repl-return)) (_ (funcall f)))) (advice-add #'paredit-RET :around #'bd/paredit-preserve-repl) diff --git a/.config/emacs/modules/bd--dictionary.el b/.config/emacs/modules/bd--dictionary.el index bf83544..e032837 100644 --- a/.config/emacs/modules/bd--dictionary.el +++ b/.config/emacs/modules/bd--dictionary.el @@ -9,6 +9,12 @@ (setopt dictionary-server "localhost" dictionary-use-single-buffer t)) +(use-package powerthesaurus + :bind (("C-c t" . powerthesaurus-transient)) + :config + (setopt powerthesaurus-show-rating nil + powerthesaurus-user-agent "Chrome/138.0.0.0")) + (provide 'bd--dictionary) ;;; bd--dictionary.el ends here diff --git a/.config/emacs/modules/bd--emms.el b/.config/emacs/modules/bd--emms.el index 456d83a..f4e5064 100644 --- a/.config/emacs/modules/bd--emms.el +++ b/.config/emacs/modules/bd--emms.el @@ -18,7 +18,7 @@ playback." (emms-stop) (when (bufferp emms-playlist-buffer-name) (kill-buffer emms-playlist-buffer-name)) - (emms-play-directory-tree (expand-file-name "~/ik/music/")) + (emms-play-directory-tree (expand-file-name "~/ik/")) (emms-shuffle)) (defun switch-to-emms () (interactive) diff --git a/.config/emacs/modules/bd--exwm.el b/.config/emacs/modules/bd--exwm.el index 8316b0f..1738ebe 100644 --- a/.config/emacs/modules/bd--exwm.el +++ b/.config/emacs/modules/bd--exwm.el @@ -3,20 +3,30 @@ ;;; Code: -(bd/set-bg) - (use-package exwm :demand t :config + + (require 'exwm-randr) + (setopt exwm-randr-workspace-monitor-plist '(0 "HDMI-1" 1 "eDP-1") + exwm-workspace-number 10) + (add-hook 'exwm-randr-screen-change-hook + (lambda () + (start-process-shell-command + "xrandr" nil + "xrandr --output HDMI-1 --mode 2560x1440 --primary --auto --left-of eDP-1 --output eDP-1 --mode 1920x1080") + (bd/set-bg))) + (exwm-randr-mode) + (defun bd/exwm-update-title () "Changes the buffer name to reflect the class name for that buffer." (exwm-workspace-rename-buffer exwm-title)) (add-hook 'exwm-update-title-hook #'bd/exwm-update-title) - (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) (exwm-enable) (setopt exwm-replace nil + exwm-manage-force-tiling nil exwm-input-prefix-keys `([?\C-x] [?\C-u] @@ -28,12 +38,13 @@ that buffer." [?\M-`] [?\M-&] [?\M-:] + [?\M-!] ,@(mapcar (lambda (i) (kbd (concat "s-" (number-to-string i)))) (number-sequence 0 9))) exwm-input-global-keys - '(([?\s-n] . other-window) + `(([?\s-n] . other-window) ([?\s-p] . (lambda () (interactive) (other-window -1))) @@ -47,15 +58,21 @@ that buffer." ([f10] . emms-next) ([print] . bd/shoot-part) ([S-print] . bd/shoot-full) - ([?\s-I] . bd/doc-finder) ([?\s-O] . bd/browse-dispatcher) ([?\s-P] . bd/password) ([?\s-r] . exwm-reset) ([?\s-d] . toggle-window-dedicated) + ([?\s-t] . bd/toggle-tab-bar) ([?\s-q] . kill-current-buffer) ([?\s-x] . (lambda (command) (interactive (list (read-shell-command "s-x "))) - (start-process-shell-command command nil command)))) + (start-process-shell-command command nil command))) + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%s" (car i))) . + (lambda () + (interactive + (exwm-workspace-switch-create ,(car (cdr i))))))) + '((! 0) (@ 1) (\# 2) ($ 3) (% 4) (^ 5) (& 6) (* 7) (\( 8) (\) 9)))) exwm-input-simulation-keys '(([?\C-b] . [left]) @@ -78,6 +95,13 @@ that buffer." ([?\M-b] . [C-left]) ([?\M-f] . [C-right])))) +(use-package exwm-outer-gaps + :defer 1 + :config + (setopt exwm-outer-gaps-mode 1 + exwm-outer-gaps-width 10) + (exwm-outer-gaps-apply)) + (use-package server :defer 1 :config @@ -87,21 +111,5 @@ that buffer." (setopt tab-bar-select-tab-modifiers '(super)) -(defvar new-mode-line nil) -(defun set-new-mode-line () - (setq new-mode-line - (replace-regexp-in-string - "%" "%%" - (format "[%s] [%s]" - (shell-command-to-string "/home/bdunahu/.local/bin/mail-string 2>/dev/null") - (shell-command-to-string "/home/bdunahu/.local/bin/t1-string 2>/dev/null"))))) - -(defvar-local bd/external-mode-line - '(:eval (when new-mode-line - new-mode-line))) - -(run-with-timer t 30 #'set-new-mode-line) -(add-to-list 'global-mode-string bd/external-mode-line) - (provide 'bd--exwm) ;;; bd--exwm.el ends here diff --git a/.config/emacs/modules/bd--files.el b/.config/emacs/modules/bd--files.el index f4c4f4f..c2f3df8 100644 --- a/.config/emacs/modules/bd--files.el +++ b/.config/emacs/modules/bd--files.el @@ -3,6 +3,11 @@ ;;; Code: +(use-package files + :config + (setopt safe-local-variable-directories + '("/home/bdunahu/pt/guix"))) + (use-package recentf :demand t :bind @@ -19,6 +24,9 @@ (defun bd/mpv (file) "Open FILE with mpv." (start-process "mpv" nil "mpv" "--force-window=yes" (expand-file-name file))) +(defun bd/info (file) + "Open FILE with info." + (info file)) (defun bd/nsxiv (file) "Open FILE with nsxiv." (start-process "nsxiv" nil "nsxiv" (expand-file-name file))) @@ -37,6 +45,7 @@ '(("gba" . "mgba") ("z64" . "mupen64plus") ("iso" . "dolphin-emu") + ("ciso" . "dolphin-emu") ("n64" . "mupen64plus") ("sfc" . "bsnes")))))) (start-process command nil command (expand-file-name file)))) @@ -53,14 +62,16 @@ (bd/open-with-function #'bd/zathura)) ((string-match (regexp-opt '("mkv" "mov" "mp4" "webm" "m4v" "wav" "mp3" "opus" "ogv" "flac" - "m4a")) ext) + "m4a" "ogg")) ext) (bd/open-with-function #'bd/mpv)) + ((string-match (regexp-opt '("info")) ext) + (bd/open-with-function #'bd/info)) ((string-match (regexp-opt '("jpg" "jpeg" "png" "webp" "ico" "gif" "JPG" "PNG")) ext) (bd/open-with-function #'bd/nsxiv)) ((string-match (regexp-opt '("qcow2")) ext) (bd/open-with-function #'bd/qemu)) - ((string-match (regexp-opt '("gba" "z64" "n64" "sfc" "iso")) ext) + ((string-match (regexp-opt '("gba" "z64" "n64" "sfc" "iso" "ciso")) ext) (bd/open-with-function #'bd/rom)) (t (apply f args))))) (advice-add #'find-file :around #'bd/external-find-file-wrapper) diff --git a/.config/emacs/modules/bd--irc.el b/.config/emacs/modules/bd--irc.el deleted file mode 100644 index 99b1a49..0000000 --- a/.config/emacs/modules/bd--irc.el +++ /dev/null @@ -1,29 +0,0 @@ -;;; -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - - -(require 'fill-column) -(use-package rcirc - :hook - ((rcirc-mode . (lambda () - (setq-local fill-column-desired-width 80) - (fill-column-mode) - (rcirc-omit-mode)))) - :config - (setopt rcirc-fill-column 80 - rcirc-omit-threshold 10 - rcirc-reconnect-delay 60 - rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY") - rcirc-track-minor-mode t - rcirc-track-ignore-server-buffer-flag t - rcirc-server-alist - '(("operationnull.com" - :nick "Gondul" - :user-name "Gondul" - :port 6697 - :encryption tls)))) - - -(provide 'bd--irc) -;;; bd--irc.el ends here diff --git a/.config/emacs/modules/bd--minibuffer.el b/.config/emacs/modules/bd--minibuffer.el index 66d14de..cf5641b 100644 --- a/.config/emacs/modules/bd--minibuffer.el +++ b/.config/emacs/modules/bd--minibuffer.el @@ -18,7 +18,7 @@ flex) icomplete-delay-completions-threshold 0 icomplete-compute-delay 0.10 - icomplete-show-matches-on-no-input t + icomplete-show-matches-on-no-input nil icomplete-separator " | " completions-max-height '30 completions-detailed t) diff --git a/.config/emacs/modules/bd--modeline.el b/.config/emacs/modules/bd--modeline.el index 5d2af9e..2ca7ccb 100644 --- a/.config/emacs/modules/bd--modeline.el +++ b/.config/emacs/modules/bd--modeline.el @@ -22,7 +22,7 @@ (defvar-local bd/buffer-identification-mode-line '(:eval (format "%s" (propertize (buffer-name) 'face (if (mode-line-window-selected-p) - 'font-lock-keyword-face + 'modus-themes-fg-cyan-intense 'mode-line-inactive)))) "Formats the modeline-buffer-name.") @@ -39,6 +39,11 @@ 'help-echo "mouse-1: Project menu" 'local-map project-mode-line-map)))))) +(defvar-local bd/global-mode-string + '(:eval (when (mode-line-window-selected-p) + global-mode-string)) + "Displays the global mode string only on the current window.") + (column-number-mode 1) (setopt mode-line-position-column-line-format '("%l:%c") mode-line-percent-position nil) @@ -63,6 +68,7 @@ (dolist (construct '(bd/buffer-identification-mode-line bd/project-mode-line bd/vc-mode-line + bd/global-mode-string bd/line-position bd/modeline-window-dedicated)) (put construct 'risky-local-variable t)) @@ -84,6 +90,8 @@ mode-line-mule-info mode-line-modified mode-line-front-space + bd/global-mode-string + mode-line-front-space )) diff --git a/.config/emacs/modules/bd--notes.el b/.config/emacs/modules/bd--notes.el index 70bc3f8..13f80f4 100644 --- a/.config/emacs/modules/bd--notes.el +++ b/.config/emacs/modules/bd--notes.el @@ -23,7 +23,8 @@ then pastes the active region." (when contents (insert (format "\n\n%s" contents))) (current-buffer))))) -(keymap-global-set "C-c s" #'bd/send-to-scratch) +(keymap-global-set "C-c s" #'scratch-buffer) +(keymap-global-set "C-c C-s" #'bd/send-to-scratch) ;; default *scratch* must have var set (add-hook 'emacs-startup-hook (lambda () @@ -62,7 +63,7 @@ KEYWORDS is a list of strings." "csu" "umass" "cs" "guix" "emacs" "programs" "mem") denote-directory (expand-file-name "~/dc/") - denote-prompts '(title file-type keywords) + denote-prompts '(title file-type keywords subdirectory) denote-dired-directories (list denote-directory))) (use-package denote-journal diff --git a/.config/emacs/modules/bd--org.el b/.config/emacs/modules/bd--org.el index 79a3de1..17790a0 100644 --- a/.config/emacs/modules/bd--org.el +++ b/.config/emacs/modules/bd--org.el @@ -51,7 +51,7 @@ (setopt org-latex-toc-command "\\tableofcontents \\clearpage" org-latex-src-block-backend 'listings org-latex-image-default-width ".6\\linewidth" - org-latex-compiler "pdflatex" + org-latex-compiler "xelatex" org-export-with-toc nil org-export-preserve-breaks nil org-latex-classes @@ -76,7 +76,6 @@ keepspaces=true} \\lstset{columns=fullflexible,basicstyle=\\ttfamily} \\setlength{\\headsep}{0.75 in} -\\setlength{\\parindent}{0 in} \\setlength{\\parskip}{0.1 in} \\makeatletter @@ -110,6 +109,15 @@ ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))) +(use-package oc + :config + (setopt org-cite-global-bibliography + (directory-files-recursively + (concat (xdg-user-dir "DOCUMENTS") "/bib/") + ".*\\.bib$") + org-cite-export-processors + '((latex biblatex)))) + (use-package org-agenda :bind (("C-c n a" . org-agenda) @@ -121,9 +129,7 @@ (advice-add 'org-refile :after 'org-save-all-org-buffers) (defvar-local bd/course-list - '(("501" . ?0) - ("535" . ?3) - ("590" . ?9)) + '(("598" . ?0)) "Courses for tagging, capturing, and various agenda views.") diff --git a/.config/emacs/modules/bd--shells.el b/.config/emacs/modules/bd--shells.el index 6fff9e6..1072694 100644 --- a/.config/emacs/modules/bd--shells.el +++ b/.config/emacs/modules/bd--shells.el @@ -48,7 +48,7 @@ allowed." (use-package em-banner :config - (setopt eshell-banner-message (concat "\n" (propertize " " 'display (create-image (expand-file-name "images/raven.png" user-emacs-directory) 'png nil :scale 0.8 :align-to "center")) "\n"))) + (setopt eshell-banner-message (concat "\n" (propertize " " 'display (create-image (expand-file-name "images/wolf.png" user-emacs-directory) 'png nil :scale 0.8 :align-to "center")) "\n"))) (use-package em-hist :config @@ -96,6 +96,8 @@ allowed." (set-text-properties (point-min) (point-max) nil) (erase-buffer) (eval eshell-banner-message))) + (defun eshell/c (&optional scrollback) + (eshell/clear scrollback)) (defun eshell/o (file) (interactive) (find-file file)) diff --git a/.config/emacs/modules/bd--tabs.el b/.config/emacs/modules/bd--tabs.el index 49549f7..6d4f12f 100644 --- a/.config/emacs/modules/bd--tabs.el +++ b/.config/emacs/modules/bd--tabs.el @@ -3,21 +3,6 @@ ;;; Code: -(use-package time - :demand t - :init - (display-time) - :config - (setopt display-time-format " [%m/%d %H:%M] " - display-time-default-load-average nil)) - -(use-package battery - :demand t - :init - (display-battery-mode) - :config - (setopt battery-update-interval 90)) - (use-package tab-bar :demand t :config @@ -28,6 +13,13 @@ (concat (tab-bar-tab-name-current) " " (bd/get-mode-line-modes (window-buffer (minibuffer-selected-window))))) + (defun bd/toggle-tab-bar () + (interactive) + (setopt tab-bar-show (not tab-bar-show)) + ;; required to wait for the frame to update + (sit-for 0) + ;; dumb outer-gaps bug + (exwm-outer-gaps-apply)) (tab-bar-select-tab 1) (tab-bar-mode) @@ -39,9 +31,7 @@ ;; remove useless gui elements tab-bar-format - '(tab-bar-format-tabs - tab-bar-format-align-right - tab-bar-format-global) + '(tab-bar-format-tabs) tab-bar-close-button-show nil tab-bar-auto-width-max nil diff --git a/.config/emacs/modules/bd--themes.el b/.config/emacs/modules/bd--themes.el index ddcfcf2..cd24cab 100644 --- a/.config/emacs/modules/bd--themes.el +++ b/.config/emacs/modules/bd--themes.el @@ -3,76 +3,113 @@ ;;; Code: -(defun bd/enable-variable-pitch-exempt () - "Text modes to exempt from variable pitch fonts." - (unless (derived-mode-p 'latex-mode 'mhtml-mode 'nxml-mode 'yaml-mode) - (variable-pitch-mode 1))) - -(defvar bd/enable-variable-pitch-in-hooks - '(text-mode-hook) - "List of hook symbols to add `variable-pitch-mode' -to.") - -(mapc - (lambda (hook) - (add-hook hook #'bd/enable-variable-pitch-exempt)) - bd/enable-variable-pitch-in-hooks) - -(set-face-attribute 'variable-pitch nil - :family "Dejavu Math TeX Gyre" - :height 110) -(set-face-attribute 'fixed-pitch nil - :family "Terminus" - :height 110) -(set-face-attribute 'default nil - :family "Terminus" - :height 140) - - (use-package modus-themes :load-path (lambda () (expand-file-name "themes/" data-directory)) :demand t + :init + (load-theme 'modus-vivendi-tinted t) + :hook + ((modus-themes-post-load . bd/modus-set-faces)) :config - ;; Disable all other themes to avoid awkward blending: - (mapc #'disable-theme custom-enabled-themes) (defun bd/modus-set-faces (&rest _) "Blends the modeline with the echo area, and some other minor face changes." (modus-themes-with-colors (custom-set-faces - `(mode-line ((,c :overline ,keyword))) - `(mode-line-inactive ((,c :overline ,bg-button-inactive))) - `(eshell-prompt ((,c :foreground ,fg-main :background ,bg-dim :height 1.1 :extend t)))))) - (add-hook 'modus-themes-post-load-hook #'bd/modus-set-faces) - + `(eshell-prompt ((,c :foreground ,fg-main :background ,bg-prose-block-contents :height 1.1 :extend t)))))) (setopt modus-themes-to-toggle '(modus-operandi-tinted modus-vivendi-tinted) modus-themes-mixed-fonts t modus-themes-italic-constructs t modus-themes-bold-constructs t - modus-themes-variable-pitch-ui nil + modus-themes-variable-pitch-ui t + modus-themes-prompts '(bold) modus-themes-headings - '((0 variable-pitch bold 1.5) - (1 variable-pitch bold 1.4) + '((0 variable-pitch regular 1.4) + (1 variable-pitch regular 1.4) (2 variable-pitch regular 1.3) - (3 variable-pitch regular 1.1) - (t variable-pitch regular 1.0)) - + (3 variable-pitch regular 1.2) + (t variable-pitch regular 1.2)) modus-themes-common-palette-overrides - '((bg-mode-line-active bg-main) - (bg-mode-line-inactive bg-main) - (border-mode-line-active bg-main) - (border-mode-line-inactive bg-main) - (bg-line-number-active bg-dim) - (bg-line-number-inactive bg-dim) - (fg-heading-1 fg-term-blue-bright) - (fg-heading-2 fg-term-magenta-bright) + '((bg-main "#000B0E") ;; primary + (bg-active bg-main) + (fg-main "#c6b7ad") + (fg-active fg-main) + (fg-mode-line-active "#008EA2") + (bg-mode-line-active "#012C31") ;; primary + (fg-mode-line-inactive "#8D6D91") + (bg-mode-line-inactive "#442c50") ;; secondary + (border-mode-line-active nil) + (border-mode-line-inactive nil) (bg-tab-bar bg-main) - (bg-tab-current bg-main) - (bg-tab-other bg-button-inactive)))) + (bg-tab-current "#042429") ;; primary + (bg-tab-other "#100014") ;; secondary + + (fg-heading-0 "#b2ebf2") + (fg-heading-1 "#98fb98") + (fg-heading-2 "#fa80e6") + (fg-heading-3 "#ff7f50") + (fg-heading-4 "#ffd700") + + (fg-prompt "#FF4E00") ;; tertiary + (bg-prompt unspecified) + + (bg-region "#E65C19") ;; tertiary + (fg-region "#fffff0") -(load-theme 'modus-vivendi-tinted :no-confirm) + (bg-hl-line "#034852") ;; primary + + (fg-line-number-active fg-main) + (fg-line-number-inactive "#a9a9a9") + (bg-line-number-active unspecified) + (bg-line-number-inactive "#0D5D62") ;; primary + + (fringe bg-main) + (cursor "#FF5300") ;; tertiary + + (fg-prose-verbatim "#af9fff") + (bg-prose-block-contents "#244449") ;; primary + (fg-prose-block-delimiter "#c6b7ad") + (bg-prose-block-delimiter bg-prose-block-contents) + + (keyword "#4dd0e1") + (builtin "#a490ff") + (comment "#afa7b0") + (string "#50f2ca") + (fnname "#d8afd8") + (type "#89c6f9") + (variable "#98fb98") + (docstring "#f0e68c") + (constant "#fa80e6")))) (run-hooks 'modus-themes-post-load-hook) +(defun bd/enable-variable-pitch-exempt () + "Text modes to exempt from variable pitch fonts." + (unless (derived-mode-p 'latex-mode 'mhtml-mode 'nxml-mode 'yaml-mode) + (variable-pitch-mode 1))) + +(defvar bd/enable-variable-pitch-in-hooks + '(text-mode-hook) + "List of hook symbols to add `variable-pitch-mode' +to.") + +(mapc + (lambda (hook) + (add-hook hook #'bd/enable-variable-pitch-exempt)) + bd/enable-variable-pitch-in-hooks) + +(set-face-attribute 'variable-pitch nil + :family "Dejavu Serif" + :height 130) +(set-face-attribute 'fixed-pitch nil + :family "Iosevka" + :height 100) +(set-face-attribute 'default nil + :family "Iosevka" + :height 140) +(set-face-attribute 'modus-themes-ui-variable-pitch nil + :family "Iosevka" + :height 90) + (provide 'bd--themes) ;;; bd--themes.el ends here diff --git a/.config/emacs/modules/bd--utility.el b/.config/emacs/modules/bd--utility.el index d48ff02..ee74f58 100644 --- a/.config/emacs/modules/bd--utility.el +++ b/.config/emacs/modules/bd--utility.el @@ -7,10 +7,12 @@ (defun bd/set-frame-alpha (value) - "Set the transparency of the frame background to VALUE. 0=transparent/100=opaque." + "Set the transparency of ALL frame backgrounds to VALUE. 0=transparent/100=opaque." (interactive "nTransparency Value (50 - 100 opaque): ") (setq value (max 50 (min value 100))) - (set-frame-parameter (selected-frame) 'alpha `(,value . ,value)) + (mapc (lambda (f) + (set-frame-parameter f 'alpha `(,value . ,value))) + (frame-list)) (message "Alpha set to %d" value)) (defun bd/set-bg (&optional arg) @@ -19,10 +21,11 @@ ARG can be one of the following: - nil: set the most recent wallpaper - directory: set a random image from the directory -- file: set the specified file - -TODO default folder" - (interactive "f") +- file: set the specified file" + (interactive + (list (read-file-name + "Select a wallpaper: " + (expand-file-name "~/wf/wall/") nil t))) (let ((wall (expand-file-name "~/wf/wall/current"))) (when arg (cond @@ -99,10 +102,12 @@ TODO default folder" '(eww-mode))) (defun bd/buffer-exwm-p (buf) - "Return non-nil if BUF is an `exwm-mode' buffer." - (member - (buffer-local-value 'major-mode (get-buffer buf)) - '(exwm-mode))) + "Return non-nil if BUF is an `exwm-mode' buffer and is in the current workspace." + (and (member + (buffer-local-value 'major-mode (get-buffer buf)) + '(exwm-mode)) + (eq (exwm-workspace--position exwm-workspace--current) + (alist-get 'exwm--desktop (buffer-local-variables (get-buffer buf)))))) (defun bd/buffer-scratch-p (buf) "Return non-nil if BUF is a scratch buffer." diff --git a/.config/emacs/modules/bd--window.el b/.config/emacs/modules/bd--window.el index 59f7dbc..bdc173b 100644 --- a/.config/emacs/modules/bd--window.el +++ b/.config/emacs/modules/bd--window.el @@ -48,7 +48,10 @@ ["" ("a" "alpha" bd/set-frame-alpha) ("w" "wallpaper" bd/set-bg) - ("t" "theme" load-theme)]]) + ("t" "theme" load-theme)] + ["" + ("z" "widen gaps" exwm-outer-gaps-increment :transient t) + ("x" "shrink gaps" exwm-outer-gaps-decrement :transient t)]]) (keymap-global-set "C-c w" #'bd/layout-dispatcher) |
