Skip to content

Instantly share code, notes, and snippets.

@sje30
Created June 4, 2020 06:36
Show Gist options
  • Save sje30/27077e9ea05c615fd84eabd1aadc1e1e to your computer and use it in GitHub Desktop.
Save sje30/27077e9ea05c615fd84eabd1aadc1e1e to your computer and use it in GitHub Desktop.
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