Created
August 5, 2019 18:51
-
-
Save mpjdem/4b7d3fe01865df944af91713ffe7732d to your computer and use it in GitHub Desktop.
Root window screenshot
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
take_screenshot <- function() { | |
xwid <- | |
system("xwininfo -root | sed -n 2p | grep -oP 0x[a-f0-9]+", | |
intern = TRUE) | |
magick::image_write(magick::image_read(paste0("x:", xwid)), | |
path = format(Sys.time(), "ss-%Y%m%d-%H%M%S.png"), | |
format = "png") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As discussed here