summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-07-30 13:53:51 +0800
committerJSDurand <mmemmew@gmail.com>2023-07-30 13:53:51 +0800
commitf5064cbde5211b439c2343c65a9cff0b783e1be5 (patch)
treea6a1320cb94581d38aaa781fc7651c7de34e41c6
parentb2907e2a5f2f49b69bce648bcc726e94775e19f7 (diff)
vterm: add a convenient function to run btm
* vterm-conf.el (btm): This convenient function runs the command "btm --battery -m" in a vterm buffer. This is my main usage for vterm, so it is worth a dedicated function in my opinion.
-rw-r--r--vterm-conf.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/vterm-conf.el b/vterm-conf.el
index 3185d0e..d568674 100644
--- a/vterm-conf.el
+++ b/vterm-conf.el
@@ -33,7 +33,16 @@
(add-hook 'vterm-mode-hook
(lambda ()
(set (make-local-variable 'buffer-face-mode-face) 'fixed-pitch)
- (buffer-face-mode t)))
+ (buffer-face-mode t)))
+
+(defun btm ()
+ "Run the command \"bpm\" in a vterm buffer."
+ (interactive)
+ (vterm)
+ (with-current-buffer vterm-buffer-name
+ (modeline-toggle))
+ (vterm-send-string "btm --battery -m")
+ (vterm-send-return))
(provide 'vterm-conf)
;;; vterm-conf.el ends here