Screenshots with Gnome+Compiz: capture window borders!

It's rather annoying that with Ubuntu GNU/Linux and Gnome desktop manager using Compiz special effects, a screenshot of only a window excludes the window border. That's now fixed!

There are lengthy back-and-forths where Gnome devs claim their stuff works and Compiz devs claim their stuff works, but put them together and it doesn't work. This has been FOUR years like this.

So some clever guy has created a script using xwininfo, scrot, xdotool, and, imagemagick to grab the border with the window.

I’ve taken the liberty to modify it, rather dramatically:

  • a Zenity pop-up to tell user to click INSIDE desired window (in case they miss the cross-hair cursor), with a Continue? Y/N option
  • detects error if user clicked title bar (frame not available) and gives pop-up error message
  • extracts screenshot file name from windows title and makes screenshot-$Title.png the default output file name
  • uses zenity –file-selector –save –confirm-overwrite to allow user to store image where ever they please

So, here without further delay, is the script, attached, below

NOTE Something wrong with permissions, links aren't available to Visitors. See comments for a copy/paste job below (until I fix permissions). Sorry!

And here's a little demo, first, a screenshot by pressing Alt+PrtScr (Print Screen):

Here it is again, using my script, showing off the lovely Crux styled title bar: