mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
Rework exwmx-launch-program
This commit is contained in:
parent
afbacc8952
commit
4c7583a8eb
2 changed files with 15 additions and 20 deletions
|
|
@ -25,26 +25,10 @@
|
|||
;;; Code:
|
||||
(use-package dmenu)
|
||||
|
||||
(make-thread
|
||||
#'dmenu--cache-executable-files)
|
||||
|
||||
(defun read-program ()
|
||||
(funcall #'ido-completing-read "$ "
|
||||
(append dmenu--history-list
|
||||
(cl-remove-if (lambda (x)
|
||||
(member x dmenu--history-list))
|
||||
dmenu--cache-executable-files))))
|
||||
|
||||
(defun launch-program (command &optional process-name)
|
||||
(interactive (list (read-program)))
|
||||
(setq dmenu--history-list (cons command (remove command dmenu--history-list)))
|
||||
(when (> (length dmenu--history-list)
|
||||
dmenu-history-size)
|
||||
(setcdr (nthcdr (- dmenu-history-size 1)
|
||||
dmenu--history-list)
|
||||
nil))
|
||||
(let ((name (or process-name command)))
|
||||
(start-process-shell-command name nil command)))
|
||||
(defun dmenu-refresh-applist ()
|
||||
(interactive)
|
||||
(make-thread
|
||||
#'dmenu--cache-executable-files))
|
||||
|
||||
(provide 'exwm-launch-program)
|
||||
;;; exwm-launch-program.el ends here
|
||||
|
|
|
|||
|
|
@ -218,6 +218,17 @@ and :title or just a key list."
|
|||
(interactive)
|
||||
(my/exwmx-quickrun ,cmd nil '(:pretty-name ,name)))))
|
||||
|
||||
(add-to-list 'vertico-multiform-commands
|
||||
'(exwmx-launch-program flat (vertico-cycle . t)))
|
||||
|
||||
(defun read-program ()
|
||||
(completing-read
|
||||
"$ "
|
||||
(append dmenu--history-list
|
||||
(cl-remove-if (lambda (x)
|
||||
(member x dmenu--history-list))
|
||||
dmenu--cache-executable-files))))
|
||||
|
||||
(defun exwmx-launch-program (command &optional process-name)
|
||||
(interactive (list (read-program)))
|
||||
(setq dmenu--history-list (cons command (remove command dmenu--history-list)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue