Screenshots with package or cmd tool

If anyone else needs to know, this works under linux with the xwd tool:

using ImageMagick

function screenshot()
    data = read(pipeline(`xwd -root`, `convert xwd:- png:-`))
    im = ImageMagick.load_(data)
end
2 Likes