View Single Post
  #4   (View Single Post)  
Old 8th June 2008
Meta_Ridley Meta_Ridley is offline
OFM Addict
 
Join Date: May 2008
Posts: 21
Default

You can use a named pipe (also known as a FIFO) to do this. First you create the named pipe with mkfifo pipe_name. Then send the output of the screen-capturing program to it. The safest way is to use stdout, which generally involves specifying "-" as the output file and using ">" to redirect the output to the pipe, like this,to use lvlamb's example:

prog Screenshot any_icon.png xwd -out - > pipe_name

Note that prog will freeze at this point ("blocked" in Unix parlance) until you "connect" the other end of the pipe. That part's easy:

cat pipe_name > your_screenshot.xwd.

Replace "your_screenshot" with the name you want to save it as. Once you use the cat command prog will continue. The result should be a screenshot with the name you want. It's sort of a hackish way of doing it, but it works.

If you're lucky then prog will know what to do with a named pipe, in which case the command you put in IceWM's menu will look like this:

prog ScreenShot any_icon.png xwd -out pipe_name

The cat command remains the same.

Last edited by Meta_Ridley; 8th June 2008 at 08:16 AM.
Reply With Quote