|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
|
Thread Tools | Display Modes |
|
|||
How launch script or command from icewm?
How launch script or command from icewm?
I would launch a script or use a plain command line to take a screenshot but i haven't find a way on icewm. $HOME/username/.icewm/keys key "Print" xterm -e xwd | convert - screenshot.png I have press the Print key but don't run. I have also tried: $HOME/username/.icewm/menu prog Screenshot xwd xwd But without result. |
|
|||
Thanks it's work.
Also i have tried the pipe command but don't work. Would be possible to specify the name after the capture of screen instead of using a name fixed? This is to avoid trying to overwrite different screenshot and also to assign a meaningful name to the captured image. |
|
|||
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. |
|
|||
Thanks.
Would be possible have a workaround to do everything in one step? |
|
|||
To my knowledge, not if you want to give every screenshot a unique name, unless you want to use a dialog box to name the file beforehand. Otherwise giving a unique name and doing it in one step from the window manager alone are mutually-exclusive.
Of course, if anyone else knows better feel free to correct me. |
|
|||
Quote:
Everything should work from menu icem and scripts does not seem to be supported. |
|
||||
make a directory ~/snapshots
you could write a one-liner wrapper as Code:
xwd | convert - ~/snapshots/$(date -j +%Y%m%d%H%M%s).png make this executable chmod +x snapshot then, just put the line in your ~/.icewm/menu file as exec an_icon.png snapshot date -j is OpenBSD specific (parse date without changing the clock), read man date for other OSes
__________________
da more I know I know I know nuttin' |
|
|||
When i tried to use exec on menu the voice disappear.
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
matts: a shell script to mail attachments from the command line | J65nko | Guides | 7 | 3rd August 2022 03:13 AM |
"free" command/perl script for freebsd | unixdude | FreeBSD General | 0 | 17th November 2008 09:23 PM |
firefox segfault in windowmaker and icewm | davidgurvich | FreeBSD General | 4 | 25th August 2008 02:58 PM |
my 1st sh script | graudeejs | Programming | 12 | 18th August 2008 10:25 PM |
Shell Script. | bsdnewbie999 | Programming | 21 | 15th July 2008 07:54 AM |