Skip to content

Instantly share code, notes, and snippets.

@lmmx
Last active August 28, 2015 00:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
linux_read_clip <- function() {
if (Sys.which("xclip") == "") {
if (Sys.which("xsel") == "") {
notify_no_clip()
} else {
con <- pipe("xsel --clipboard")
}
} else {
con <- pipe("xclip -o -selection clipboard")
}
content <- readLines(con)
close(con)
return(content)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment