diff options
author | jao <jao@gnu.org> | 2022-01-27 22:40:23 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-01-27 22:40:23 +0000 |
commit | 305d1c5931a25f36bd2ba89b77971773b0de7ac4 (patch) | |
tree | 4eac521ab945e7a2458a5ae2e502acaa785ced2e /init.org | |
parent | 6f987a738fe23c269cb2045c8b1e01b946381e9e (diff) | |
download | elibs-305d1c5931a25f36bd2ba89b77971773b0de7ac4.tar.gz elibs-305d1c5931a25f36bd2ba89b77971773b0de7ac4.tar.bz2 |
nits
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -1814,18 +1814,15 @@ (term-send-string nil (concat cmd " ; exit\n")))) (defmacro jao-def-exec-in-term (name cmd &rest prelude) - `(defun ,(intern (format "jao-term-%s" name)) () - (interactive) + `(defun ,(intern (format "jao-term-%s" name)) (&optional term) + (interactive "P") ,@prelude - (if-let ((b (jao-term--find ,cmd))) - (pop-to-buffer b) - (jao-exec-in-term ,cmd ,(format "*%s*" name)) - (setq-local jao-term--cmd ,cmd)))) + (let ((jao-use-vterm (if term (not jao-use-vterm) jao-use-vterm))) + (if-let ((b (jao-term--find ,cmd))) + (pop-to-buffer b) + (jao-exec-in-term ,cmd ,(format "*%s*" name)) + (setq-local jao-term--cmd ,cmd))))) - (jao-def-exec-in-term "aptitude" "aptitude" (jao-afio--goto-scratch)) - (jao-def-exec-in-term "htop" "htop" (jao-afio--goto-scratch)) - (jao-def-exec-in-term "spt" "spt" (jao-afio--goto-scratch)) - (jao-def-exec-in-term "ncmpcpp" "ncmpcpp" (jao-afio--goto-scratch)) #+end_src *** eshell ***** Basic custom @@ -2920,6 +2917,8 @@ (defalias 'jao-spotify-artist #'consult-spotify-artist) (defalias 'jao-spotify-playlist #'consult-spotify-playlist) + (jao-def-exec-in-term "ncmpcpp" "ncmpcpp" (jao-afio--goto-scratch)) + (use-package jao-mpris :demand t :config @@ -2959,6 +2958,8 @@ (defun jao-spt-on-p () jao-spt-on) (jao-spt-setup-aliases) + (jao-def-runner jao-term-spt 0 "spt" "xterm" "-e" "spt") + (defun jao-spotify-toggle-player () (interactive) (if jao-spt-on (jao-mpris-setup-aliases) (jao-spt-setup-aliases)) @@ -3038,6 +3039,9 @@ (use-package jao-random-album :demand t) + (jao-def-exec-in-term "aptitude" "aptitude" (jao-afio--goto-scratch)) + (jao-def-exec-in-term "htop" "htop" (jao-afio--goto-scratch)) + (transient-define-prefix jao-transient-spotify () [:description (lambda () (format "Spotify using %s" (if jao-spt-on "spt" "MPRIS"))) |