Skip to content

Instantly share code, notes, and snippets.

@lmmx
Last active August 28, 2015 00:52
Show Gist options
  • Save lmmx/f64dc1b3ec5307774fd2 to your computer and use it in GitHub Desktop.
Save lmmx/f64dc1b3ec5307774fd2 to your computer and use it in GitHub Desktop.
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