From f5064cbde5211b439c2343c65a9cff0b783e1be5 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sun, 30 Jul 2023 13:53:51 +0800 Subject: 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. --- vterm-conf.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'vterm-conf.el') 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 -- cgit v1.2.3-18-g5258