-1

I just discovered screenshots possibilities using client.content property.
So to test this functionnality, I put this code and bind it to the XF86Reload key :

awful.key({  },        "XF86Reload",     function()                                                                        
     local i = 0                                                                                                          
     for c in awful.client.iterate(function() return true end)                                                            
     do                                                                                                                   
        local f = c.name                                                                                                  
        gears.surface(c.content):write_to_png( "/home/david/" .. string.format('%02i',i) .."-" .. f  ..  ".png")          
        i=i+1                                                                                                             
     end                                                                                                                  
end)

Unfortunately, some images are puzzled. Is the Cairo surface needs to be on the screen (ie non minimized) to be properly shot? (it seems it's also happening sometimes to visible windows) or maybe some other reason I can't see...

david
  • 1,302
  • 1
  • 10
  • 21

2 Answers2

0

Is the Cairo surface needs to be on the screen (ie non minimized) to be properly shot?

Yes (and also: may not be obscured by other windows or outside of the visible space; you can only get what is actually shown on the display).

Uli Schlachter
  • 9,337
  • 1
  • 23
  • 39
  • Thanks Uli. Even if there are many solutions outside awesome, this feature is indeed awesome! Finally I added a camera style icon in titlebar's clients sont that as I use it, the content is obviously visible. Once again, thanks. – david Mar 17 '18 at 12:07
0

Also note that running Compton or another compositing manager makes it a lot more reliable