My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Project Information


When run without any argument, xgetc will run forever and will respond to mouse click by printing the pixel color (in hexadecimal notation) and position to stdout. When a selection is made, xgetc will print the geometry of the selection instead (widthXheight+x+y).

Command line options can be specified to limit the output to any of selection geometry, mouse position and pixel color.

Sample Usage

1) Emulate twm-esque behavior on your Gnome/KDE supercharged desktop:

  xclock -geometry `xgetc -g`
Select a rectangular area on your screen and xclock window will be limited to that area, plus some offset for the window manager title bar. twm, anyone?

2) Getting the color of some random pixel on your screen from inside vim (if you click it, they will come):

In somefile.css:
.blue {
xgetc -c         <-- hit !!sh on this line in vim, then click anywhere on your screen
                     and voila!, the pixel color will be there.

3) Use your imagination.

Related tools

See these other tools for automating your X session:

wmctrl -

xdotool -

xwit, and the set of tools in xautomation.

Similar tool (prior art :) - grabc: grabc shows the pixel color of the clicked position and prints the color both in hex (to stdout) and rgb (to stderr).

Powered by Google Project Hosting