neXromancers/shotgun

Screenshot with window title

Closed this issue · 5 comments

How can i take a screenshot with the window title? For example with import there is the parameter -frame to take screenshots including the window title.

Iam using shotgun like this: shotgun -i "$windowID"

9ary commented

If you're using a reparenting window manager, you need to give shotgun the ID of the parent window (the easiest way to find it is probably using xdotool). That's pretty much what import -frame does. If your window manager is non-reparenting and renders decorations another way then your only option would be to capture the root window including decorations in the geometry.

Thanks for the fast answer, but iam already giving shotgun the ID. I tested it with a screenshot of the command line. I used xdotool selectwindow to get the ID, then i did a screenshot with shotgun -i "$windowID" and one with import -frame -window "$windowID" but i got only with import a screenshot with the window title.

9ary commented

You misunderstood my answer. You need to find the ID of the parent window, that's the one with the decorations.
Now that I'm looking at the documentation for xdotool, it's not immediately clear how to do that. Have you tried clicking on the title itself?
Alternatively you could try hacksaw instead of xdotool, that should do what you want.

Thanks, now i understand you. You can get the parent Window ID with xwininfo -frame but you need to manually select the window then, to get the parent Window ID. Iam trying right now to get it working without manually selecting the window.

9ary commented

I'll go ahead and close this issue then. Feel free to post any solution you come up with, but since this isn't a problem with shotgun there's no point in keeping this open.