summaryrefslogtreecommitdiff
path: root/src/wasp-utils.el
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasp-utils.el')
-rw-r--r--src/wasp-utils.el27
1 files changed, 27 insertions, 0 deletions
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