Created
June 4, 2020 06:36
-
-
Save sje30/27077e9ea05c615fd84eabd1aadc1e1e to your computer and use it in GitHub Desktop.
Snippet to yank current Chrome URL into Emacs buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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