Subject: FVWM: Screenshot done from MenuItem

From: calmar <[email-masked]>
Date: Wed, 25 Feb 2004 20:06:09 +0100

Hi all,

In order I can make screenshots easily, I bound this command to a
key:
Key F12 A 1 exec sleep 3 && import -window root ~/pics/screenshots/sc-`date +%F-%H-%M-%S`.jpg

Obviously the F12 Mod1(Alt) combination is not available here
when a menu is open, so when I want to make a screenshot, I have
to execute this command (shortcut)  when no Menu is open, then with the sleep
3 command I have enough time to open a menu I like.

So besides that it's interesting why Menu is obviously not
included in the 'A', it's all ok.

Anyway, when I want to put about the same into a Menu, it
obviously does not work at all then. P.e:

DestroyMenu testmenu
AddToMenu   testmenu
+ "screenshot"                         Exec  exec sleep 3 && import -window root ~/pics/screenshots/sc-`date +%F-%H-%M-%S`.jpg

I won't really need it, but It would again be interesting why I
does not work..

Greetings
marco candrian

-- 
  calmar 
           (o_         GNU/Linux is GREAT      
           //\                 
           V_/_        http://www.calmar.ws 

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Ben Winslow <[email-masked]>
Date: Wed, 25 Feb 2004 17:17:55 -0500

> + "screenshot"                         Exec  exec sleep 3 && import -window root ~/pics/screenshots/sc-`date +%F-%H-%M-%S`.jpg
                                         ^^^^^^^^^^
Your doubled exec causes fvwm to pass 'exec sleep 3' to the shell. 
'exec' in a shell replaces the shell task with the new one, so the shell
goes away after running sleep.

-- 
Ben Winslow <[email-masked]>

---

From: calmar <[email-masked]>
Date: Thu, 26 Feb 2004 06:49:21 +0100

Ben Winslow <[email-masked]> writes:

Hi Ben,

>> + "screenshot"                         Exec  exec sleep 3 && import -window root ~/pics/screenshots/sc-`date +%F-%H-%M-%S`.jpg

I see...
I thought I always have to use Exec exec, and I have this
everywhere too. Obviously fvwm transfers everything after
the (first) Exec to the shell.

It works now nicely, thanks

marco

---

From: calmar <[email-masked]>
Date: Thu, 26 Feb 2004 07:00:51 +0100

Stephen R Dennison <[email-masked]> writes:

> I have this item in a menu:
> + "Screen Cap" Exec exec screencap 5
>
> I have the following in a file ~/bin/screencap:
> #!/bin/bash
> sleep $1
> import -window root ~/screencaps/`date +%a``ls ~/screencaps/|wc
> -l|bc`.jpeg
>
> The funny looking command creates a jpeg image in the screencaps
> directory of my home directory, the name of the file is the current day
> as a three letter abbreviation with the number of images in the folder
> tacked on to the end to prevent them from over writing eachother.  For
> example, if I were to use the menu item on a sunday then I would have
> Sun0.jpeg in the screencaps directory after I took a screen shot.
>
> The 5 after the menu option makes the script sleep for 5 seconds before
> taking the scren cap.

Thats pretty nice, and usefule also for other tasks that comes to
my mind.

the bc at the end is just to make sure it's `only' a number, even
so <here> without it, it seems to work too?

thanks and greetings
marco candrian

---

From: Remko Troncon <[email-masked]>
Date: Sat, 28 Feb 2004 11:18:18 +0100

> everywhere too. 

That's ok, most things after an Exec _are_ single commands, and so they
can overwrite their environment. Only when you start using && and such,
you should pay attention that your last and only your last calls have an exec.

cheers,
Remko