Posts Tagged ‘Development’

Porting Windows behaviour to Linux :)

Wednesday, July 7th, 2010

In the olden days when I still used Windows, I loved having the ALT+PrintScreen keycombo around, it makes a screen capture of only the currently active window, nicely cropped and everything. This saves you the hassle of aligning it pixel-perfect in Paint. On Linux, at least using awesome, I haven’t been able to do this, so I wrote a quick script that allows me to do that and a bit more.

grabw is a bash script that allows you to

  1. Take a screenshot of a window by X window ID
  2. Take a screenshot of a window the user first has to click, using xwininfo
  3. The above two with or without asking for a filename using Zenity’s file selection dialogue window

Combine this with awesome’s ability to spawn processes on the fly and pass parameters (such as window IDs, *hint hint*) this is one feature I’m glad to have back

grabw 0.2 has been released into public domain, you can find it on my projects page.