Skip to content

Instantly share code, notes, and snippets.

@sje30
Created Jun 4, 2020
Embed
What would you like to do?
Snippet to yank current Chrome URL into Emacs buffer
(defun yank-url-from-chrome ()
"Grab the current URL from Chrome and yank into point."
(interactive)
(shell-command
"xdotool search --onlyvisible --class Chrome windowfocus key ctrl+l key ctrl+c")
(shell-command
"xdotool search --onlyvisible --class Emacs windowfocus key ctrl+y"))
(defalias 'yu 'yank-url-from-chrome)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment