Skip to content

Instantly share code, notes, and snippets.

@jeeger
Created August 11, 2023 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeeger/5d78788bf8629e6ec1610c460e2e4a0b to your computer and use it in GitHub Desktop.
Save jeeger/5d78788bf8629e6ec1610c460e2e4a0b to your computer and use it in GitHub Desktop.
(defun emacs-ime (&optional close-frame)
(interactive)
(let ((char (with-temp-buffer
(call-interactively 'insert-char)
(buffer-string))))
(when close-frame
(delete-frame))
(gui-set-selection 'CLIPBOARD char)
(start-process "xdotool"
"*emacs-ime*"
"xdotool" "sleep" "0.5" "type" char)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment