Fix shell-command composition bug
This commit is contained in:
parent
8bcf6530e5
commit
c86a03d8c3
10
imeks.el
10
imeks.el
|
@ -94,23 +94,23 @@ if an X keyboard."
|
||||||
(nconc delete-frame-functions '(imeks--handle-delete-frame))
|
(nconc delete-frame-functions '(imeks--handle-delete-frame))
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
;;; Util
|
;;; Util
|
||||||
;;; ―――――――――――――――――――――――――――――――――――――
|
;;; ―――――――――――――――――――――――――――――――――――――
|
||||||
(defun xdotool-type-string (string &optional delay)
|
(defun xdotool-type-string (string &optional delay)
|
||||||
"Types a STRING to the current X display, using xdotool.\n
|
"Types a STRING to the current X display, using xdotool.\n
|
||||||
Optionally waits a DELAY in seconds before typing the string."
|
Optionally waits a DELAY in seconds before typing the string."
|
||||||
(let* ((sleep-cmd
|
(let* ((sleep-cmd
|
||||||
(format "sleep %f;" (or delay 0)))
|
(format "sleep %f" (or delay 0)))
|
||||||
(type-cmds
|
(type-cmds
|
||||||
(mapcar (lambda (line)
|
(mapcar (lambda (line)
|
||||||
(format "%s type \"$(cat <<'EOF'\n%s\nEOF\n)\""
|
(format "%s type \"$(cat <<'EOF'\n%s\nEOF\n)\""
|
||||||
imeks-xdotool-path line))
|
imeks-xdotool-path line))
|
||||||
(string-lines string)))
|
(string-lines string)))
|
||||||
(type-cmd ; Work-around, since not all programs accept a typed newline.
|
(type-cmd ; Work-around, since not all programs accept a typed newline.
|
||||||
(reduce (lambda (a b)
|
(seq-reduce (lambda (a b)
|
||||||
(format "%s; %s key return; %s" a imeks-xdotool-path b))
|
(format "%s; %s key return; %s" a imeks-xdotool-path b))
|
||||||
type-cmds))
|
type-cmds ""))
|
||||||
(cmd-string
|
(cmd-string
|
||||||
(concat sleep-cmd type-cmd)))
|
(concat sleep-cmd type-cmd)))
|
||||||
(call-process "bash" nil 0 nil
|
(call-process "bash" nil 0 nil
|
||||||
|
|
Ŝarĝante…
Reference in New Issue