From 6fa49e57f7313aad8852ce2721c2fcf7d0cec030 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 26 Apr 2024 01:53:24 -0400 Subject: Updates --- src/wasp-utils.el | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/wasp-utils.el') diff --git a/src/wasp-utils.el b/src/wasp-utils.el index 875295b6..5ebcdb00 100644 --- a/src/wasp-utils.el +++ b/src/wasp-utils.el @@ -4,9 +4,11 @@ (require 's) (require 'f) +(require 'rx) (require 'cl-lib) (require 'eieio) (require 'request) +(require 'ef-themes) (defcustom w/log-buffer "*wasp-log*" "Name of buffer used to store the log." @@ -72,6 +74,10 @@ Optionally append EXT to the path." (with-temp-file path (insert str)) path)) +(defun w/message-ping (msg) + "Given MSG, extract a user pinged." + (cadr (s-match (rx "@" (group (one-or-more (any alnum "_")))) msg))) + (defun w/decode-string (s) "Decode the base64 UTF-8 string S." (decode-coding-string (base64-decode-string s) 'utf-8)) @@ -188,5 +194,26 @@ If TEXT is nil, use the empty string instead." "Retrieve the value for string key K in alist A." (alist-get k a nil nil #'s-equals?)) +(defun w/change-theme (theme) + "Change the current theme to THEME." + (ef-themes-select theme) + (ef-themes-with-colors + (setenv "COLONQ_BGCOLOR" bg-main) + (set-face-attribute + 'vertical-border nil + :foreground bg-alt + :background bg-alt) + (set-face-attribute + 'fringe nil + :foreground bg-alt + :background bg-alt)) + (ef-themes-with-colors + (set-face-attribute + 'eshell-prompt nil + :foreground fg-main + :background bg-alt + :weight 'bold + :extend t))) + (provide 'wasp-utils) ;;; wasp-utils.el ends here -- cgit v1.2.3