ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] better expose


From: Florian Cramer
Subject: Re: [RP] better expose
Date: Wed Nov 19 06:39:04 2003
User-agent: Mutt/1.5.4i

Am Donnerstag, 20. November 2003 um 02:35:31 Uhr (+1100) schrieb twb:
> I didn't like the little x%2 test, so I souped it up.  It's perl now.

Very cool, great work! (I actually pondererd a similar idea - using
calculations to yield a better split geometry, but thought it was too
much a hassle doing that in a shell script using bc or similar hacks...)

I send you a slightly modified version which emulates the behaviour of
my shell hack, i.e. pauses for $sleep amount of seconds if a number is
given as an argument, or, if called without numerical argument, lets the
user fselect a window. (This requires the newest CVS releases of
ratpoison. The hack with an additional "rpi" subroutine is not very
nice, perhaps it would be better to allow two different inputs into the
subroutine, one for optional commandline switches and one for the actual
ratpoison command.)

-F


*** expose.pl   2003-11-19 15:36:23.000000000 +0100
--- expose-modified.pl  2003-11-19 15:27:35.000000000 +0100
***************
*** 7,12 ****
--- 7,13 ----
  
  
  sub rp { return `$RATPOISON -c "@_"`; }
+ sub rpi { return `$RATPOISON -i -c "@_"`; }
  sub rp_batch {
      while (<>) {
        chomp;
***************
*** 35,41 ****
      foreach $frame (split(/,/,$debug)) {
        printf "%2d|%4d|%4d|%4d|%4d|%8d|%3d\n", split(/ /,$frame);
      } printf "\n";
! }
  
  sub simple_vsplit {
      my($X,$Y,$W,$H,$N,$n_OFFSET,@XIDS) = @_;
--- 36,42 ----
      foreach $frame (split(/,/,$debug)) {
        printf "%2d|%4d|%4d|%4d|%4d|%8d|%3d\n", split(/ /,$frame);
      } printf "\n";
! };
  
  sub simple_vsplit {
      my($X,$Y,$W,$H,$N,$n_OFFSET,@XIDS) = @_;
***************
*** 115,129 ****
      return join("", @fdump_new);
  }
  
! $sleep = 4;
  #choose on of:
! rp "frestore",   simple_vsplit($X, $Y, $W, $H, $N, 0, @XIDS); sleep $sleep;
! rp "frestore",    simple_split($X, $Y, $W, $H, $N, 0, @XIDS); sleep $sleep;
! rp "frestore", mediocre_vsplit($X, $Y, $W, $H, $N, 0, @XIDS); sleep $sleep;
! rp "frestore",  mediocre_split($X, $Y, $W, $H, $N, 0, @XIDS); sleep $sleep;
! rp "frestore", $fdump_original; #rp "select 0x$XID"; #Can't select by XID yet 
:-(
! 
! debug simple_split($X, $Y, $W, $H, $N, 0, @XIDS);
  
! debug mediocre_split($X, $Y, $W, $H, $N, 0, @XIDS);
  
--- 116,141 ----
      return join("", @fdump_new);
  }
  
! if ($ARGV[0] =~ /[1-9]/) {
!       $sleep = $ARGV[0];
!       $sleep =~ s/[^0-9]//g;
!       if ($sleep gt 30) {$sleep = 30}
!       }
  #choose on of:
! #rp "frestore",   simple_vsplit($X, $Y, $W, $H, $N, 0, @XIDS);
! #rp "frestore",    simple_split($X, $Y, $W, $H, $N, 0, @XIDS);
! #rp "frestore", mediocre_vsplit($X, $Y, $W, $H, $N, 0, @XIDS);
! rp "frestore",  mediocre_split($X, $Y, $W, $H, $N, 0, @XIDS); 
! if ($sleep) {
!       sleep $sleep;
!       rp "frestore", $fdump_original; 
!       # rp "select 0x$XID"; #Can't select by XID yet :-(
! }
! else {
!       rpi "fselect";
!       rp "only";
! }
  
! #debug simple_split($X, $Y, $W, $H, $N, 0, @XIDS);
  
+ #debug mediocre_split($X, $Y, $W, $H, $N, 0, @XIDS);
-- 
http://userpage.fu-berlin.de/~cantsin/homepage/
http://www.complit.fu-berlin.de/institut/lehrpersonal/cramer.html
GnuPG/PGP public key ID 3200C7BA, finger address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]