Re: FVWM: Piperead vs. Exec

From: Tim Phipps <Tim_Phipps_at_bigfoot.com>
Date: Fri, 05 May 2000 16:15:50 +0100

Neil Zanella wrote:
>
> Hello,
>
> I cannot see that Piperead would be any more useful than Exec.
> Could anyone give me an example of a useful Piperead command
> that cannot be implemented as an Exec command?

/////// shell script called fvwmresizemove ///////

#!/home/tim/SunOS/bin/bash
# script to animate window reposition
# for use by fvwm only
# usage: $0 <windowid> new_width new_height new_x new_y border_width
title_height
# new_things have a `p' on the end which should be removed
id=$1; nw=${2%p}; nh=${3%p}; nx=${4%p}; ny=${5%p}; bw=$6; th=$7
nw=$((nw + 2 * bw))
nh=$((nh + 2 * bw + th))
xwininfo -id $id | {
  read z; read z; read z
  read z z z ox
  read z z z oy
  read z; read z
  read z ow
  read z oh
  ox=$((ox - bw))
  oy=$((oy - bw - th))
  ow=$((ow + 2 * bw))
  oh=$((oh + 2 * bw + th))

  echo "SendToModule FvwmAnimate animate $ox $oy $ow $oh $nx $ny $nw
$nh"
}

//// fvwm function ////

AddToFunc my_resizemove I PipeRead "fvwmresizemove $w $0 $1 $2 $3 5 17"
+ I ResizeMove $0 $1 $2 $3

AddToFunc my_topleft I my_resizemove 566p 376p 0p 0p
AddToFunc my_topmid I my_resizemove 566p 376p 288p 0p
AddToFunc my_topright I my_resizemove 566p 376p 576p 0p
AddToFunc my_midleft I my_resizemove 566p 780p 0p 0p
AddToFunc my_midmid I my_resizemove 566p 780p 288p 0p
AddToFunc my_midright I my_resizemove 566p 780p 576p 0p
AddToFunc my_botleft I my_resizemove 566p 376p 0p 403p
AddToFunc my_botmid I my_resizemove 566p 376p 288p 403p
AddToFunc my_botright I my_resizemove 566p 376p 576p 403p
Key KP_7 WTSF M my_topleft
Key KP_8 WTSF M my_topmid
Key KP_9 WTSF M my_topright
Key KP_4 WTSF M my_midleft
Key KP_5 WTSF M my_midmid
Key KP_6 WTSF M my_midright
Key KP_1 WTSF M my_botleft
Key KP_2 WTSF M my_botmid
Key KP_3 WTSF M my_botright

////////

I bind the numeric key pads to call my_resizemove so that I can tile
windows easily. The piperead script makes FvwmAnimate draw an animation
of where the window is going to. Using an Exec would mean the animation
happening some indeterminate amount of time _after_ the ResizeMove (not
cool).

I have a similar one for closing windows which animates from the window
frame down to a tiny dot, just like when you switch off an old TV.

Cheers,
Tim.
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Fri May 05 2000 - 10:18:35 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:50 BST