summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorsabetts <sabetts>2006-03-16 00:33:34 +0000
committersabetts <sabetts>2006-03-16 00:33:34 +0000
commit9cb1a3d51b8cba35ef443c64b5b1d99fa8d33ae6 (patch)
treec6b2230a429ae887eed80487d1833c1eec129447 /contrib
parent0ad6d8b36f975c43f37b0ad07112c2cd31003417 (diff)
downloadratpoison-9cb1a3d51b8cba35ef443c64b5b1d99fa8d33ae6.zip
remove tabs and trailing whitespace.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/clickframe.pl33
-rwxr-xr-xcontrib/genrpbindings102
-rw-r--r--contrib/nogaps.el4
-rw-r--r--contrib/ratpoison.el20
-rw-r--r--contrib/rpshowall.sh56
-rwxr-xr-xcontrib/rpws35
-rw-r--r--contrib/unrat.c50
7 files changed, 149 insertions, 151 deletions
diff --git a/contrib/clickframe.pl b/contrib/clickframe.pl
index 474a9a0..e4836b9 100644
--- a/contrib/clickframe.pl
+++ b/contrib/clickframe.pl
@@ -35,15 +35,15 @@ foreach $frame (@framelist) {
($num,$left,$top,$width,$height,$win,$access) = split(/ /,$frame);
if ($x_loc > $left && $x_loc < $left + $width && $y_loc > $top && $y_loc < $top + $height) {
# Tell ratpoison to switch to the frame
- print "User clicked in frame $num\n";
- system ("$ratpoison_bin -c \"fselect $num\"");
+ print "User clicked in frame $num\n";
+ system ("$ratpoison_bin -c \"fselect $num\"");
}
}
__END__
---- xbindkeys.c~ 2003-04-06 08:43:27.000000000 -0700
-+++ xbindkeys.c 2003-09-24 11:46:20.000000000 -0700
+--- xbindkeys.c~ 2003-04-06 08:43:27.000000000 -0700
++++ xbindkeys.c 2003-09-24 11:46:20.000000000 -0700
@@ -143,7 +143,15 @@
@@ -61,21 +61,20 @@ __END__
static void
@@ -240,6 +248,8 @@
- | Button1Mask | Button2Mask | Button3Mask
- | Button4Mask | Button5Mask);
+ | Button1Mask | Button2Mask | Button3Mask
+ | Button4Mask | Button5Mask);
-+ add_button_env (e.xbutton.x, e.xbutton.y);
++ add_button_env (e.xbutton.x, e.xbutton.y);
+
- for (i = 0; i < nb_keys; i++)
- {
- if (keys[i].type == BUTTON && keys[i].event_type == PRESS)
+ for (i = 0; i < nb_keys; i++)
+ {
+ if (keys[i].type == BUTTON && keys[i].event_type == PRESS)
@@ -266,6 +276,8 @@
- | Button1Mask | Button2Mask | Button3Mask
- | Button4Mask | Button5Mask);
+ | Button1Mask | Button2Mask | Button3Mask
+ | Button4Mask | Button5Mask);
-+ add_button_env (e.xbutton.x, e.xbutton.y);
++ add_button_env (e.xbutton.x, e.xbutton.y);
+
- for (i = 0; i < nb_keys; i++)
- {
- if (keys[i].type == BUTTON && keys[i].event_type == RELEASE)
-
+ for (i = 0; i < nb_keys; i++)
+ {
+ if (keys[i].type == BUTTON && keys[i].event_type == RELEASE)
diff --git a/contrib/genrpbindings b/contrib/genrpbindings
index cf90b06..dffa99c 100755
--- a/contrib/genrpbindings
+++ b/contrib/genrpbindings
@@ -73,16 +73,16 @@ print ELISP <<PREAMBLE;
(defun ratpoison-cmd (cmd &rest args)
(with-temp-buffer
(call-process ratpoison-program nil (current-buffer) t
- "-c" (format "%s %s"
- cmd
- (mapconcat (lambda (x)
- (if (stringp x)
- x
- (prin1-to-string x)))
- args " ")))
+ "-c" (format "%s %s"
+ cmd
+ (mapconcat (lambda (x)
+ (if (stringp x)
+ x
+ (prin1-to-string x)))
+ args " ")))
(buffer-substring (point-min) (if (> (point-max) 1)
- (- (point-max) 1)
- (point-max)))))
+ (- (point-max) 1)
+ (point-max)))))
PREAMBLE
# RUBY preamble
@@ -113,28 +113,28 @@ print COMMONLISP <<PREAMBLE;
(defmacro defun-ratpoison (cmd)
(let ((sym (intern (concatenate 'string "RP-" (symbol-name cmd)))))
`(progn (defun ,sym (&rest args)
- (apply 'ratpoison-cmd ,(string-downcase (symbol-name cmd)) args))
- (export ',sym))))
+ (apply 'ratpoison-cmd ,(string-downcase (symbol-name cmd)) args))
+ (export ',sym))))
(defun ratpoison-cmd (cmd &rest args)
(labels ((mapconcat (fn list sep)
- (apply 'concatenate 'string
- (loop for x on list
- collect (if (cdr x)
- (concatenate 'string (funcall fn (car x)) sep)
- (funcall fn (car x))))))
- (build-cmd (cmd args)
- (mapconcat (lambda (x)
- (if (stringp x)
- x
- (prin1-to-string x)))
- (nconc (list cmd) args) " ")))
+ (apply 'concatenate 'string
+ (loop for x on list
+ collect (if (cdr x)
+ (concatenate 'string (funcall fn (car x)) sep)
+ (funcall fn (car x))))))
+ (build-cmd (cmd args)
+ (mapconcat (lambda (x)
+ (if (stringp x)
+ x
+ (prin1-to-string x)))
+ (nconc (list cmd) args) " ")))
(let ((stream (port:pipe-input ratpoison-program
- "-c" (build-cmd cmd args))))
+ "-c" (build-cmd cmd args))))
(do ((line (read-line stream nil nil)
- (read-line stream nil nil))
- (accum nil (cons line accum)))
- ((null line) accum)))))
+ (read-line stream nil nil))
+ (accum nil (cons line accum)))
+ ((null line) accum)))))
PREAMBLE
# python preamble
@@ -146,37 +146,37 @@ def rp_command( *args ):
p = os.popen( ratpoison + '"' + (' '.join( args ) ) + '"', 'r' )
r = p.readlines();
p.close();
- return r
+ return r
PREAMBLE
# bindings
while (<ACTIONS_C>) {
if (m!/\*\@begin !) {
- while (<ACTIONS_C>)
- {
- last if (m!/\*\@end !);
- if (/\s*add_command\s*\(\"([^\"]+)\",\s*[^\"]+,\s*([0-9]+),\s*[0-9]+,\s*([0-9]+)/) {
- my $name = $1;
- my $numargs = $2;
- my $optargs = $3;
-
- # Skip the arguments
- for (my $i=0; $i<$numargs; $i++) {
- <ACTIONS_C>;
- }
-
- $nbindings++;
- print PERL "sub $name { return command (\"$name\", \@_); }";
- print ELISP "(defun-ratpoison $name)";
- print COMMONLISP "(defun-ratpoison $name)";
- print RUBY " def $name (*args)";
- print RUBY " return command (\"$name\", args)";
- print RUBY " end";
- print RUBY " module_function :$name\n";
- print PYTHON "def rp_$name( *args ): return rp_command ( '$name ' + ' '.join( args ) )";
- }
- }
+ while (<ACTIONS_C>)
+ {
+ last if (m!/\*\@end !);
+ if (/\s*add_command\s*\(\"([^\"]+)\",\s*[^\"]+,\s*([0-9]+),\s*[0-9]+,\s*([0-9]+)/) {
+ my $name = $1;
+ my $numargs = $2;
+ my $optargs = $3;
+
+ # Skip the arguments
+ for (my $i=0; $i<$numargs; $i++) {
+ <ACTIONS_C>;
+ }
+
+ $nbindings++;
+ print PERL "sub $name { return command (\"$name\", \@_); }";
+ print ELISP "(defun-ratpoison $name)";
+ print COMMONLISP "(defun-ratpoison $name)";
+ print RUBY " def $name (*args)";
+ print RUBY " return command (\"$name\", args)";
+ print RUBY " end";
+ print RUBY " module_function :$name\n";
+ print PYTHON "def rp_$name( *args ): return rp_command ( '$name ' + ' '.join( args ) )";
+ }
+ }
}
}
print "$nbindings bindings.";
diff --git a/contrib/nogaps.el b/contrib/nogaps.el
index c1d2649..358319e 100644
--- a/contrib/nogaps.el
+++ b/contrib/nogaps.el
@@ -9,5 +9,5 @@
(defun ratpoison-nogaps ()
(let ((wins (mapcar 'string-to-number (split-string (ratpoison-windows "%n")))))
(loop for n in wins
- for i from 1 to (length wins)
- do (ratpoison-number i n))))
+ for i from 1 to (length wins)
+ do (ratpoison-number i n))))
diff --git a/contrib/ratpoison.el b/contrib/ratpoison.el
index afa501e..97bf2c0 100644
--- a/contrib/ratpoison.el
+++ b/contrib/ratpoison.el
@@ -8,7 +8,7 @@
;; Maintainer: Gergely Nagy <algernon@debian.org>
;; Version: 0.2
;; Keywords: faces, ratpoison, X
-;; CVS Id: $Id: ratpoison.el,v 1.4 2004/12/02 00:33:22 sabetts Exp $
+;; CVS Id: $Id: ratpoison.el,v 1.5 2006/03/16 00:33:34 sabetts Exp $
;; Last updated: <2001/10/05 17:58:38 algernon>
;; This file is NOT part of GNU Emacs.
@@ -132,15 +132,15 @@
ratpoison-commands-rest font-lock-builtin-face "^[ \t]*" "[ \t]+")
;; exec <arg>
(list "^[ \t]*\\(exec\\)[ \t]+\\(.*\\)"
- '(1 'font-lock-builtin-face)
- '(2 'font-lock-string-face))
+ '(1 'font-lock-builtin-face)
+ '(2 'font-lock-string-face))
;; arguments, the first is a keyword, the rest is tring
(list (concat
- (car (generic-make-keywords-list
- ratpoison-commands-rest font-lock-builtin-face "^[ \t]*" "[ \t]+"))
- "\\([0-9a-zA-Z\\/\\.\\-]+\\)[ \t]*\\(.*\\)")
- '(2 'font-lock-keyword-face)
- '(3 'font-lock-string-face)))
+ (car (generic-make-keywords-list
+ ratpoison-commands-rest font-lock-builtin-face "^[ \t]*" "[ \t]+"))
+ "\\([0-9a-zA-Z\\/\\.\\-]+\\)[ \t]*\\(.*\\)")
+ '(2 'font-lock-keyword-face)
+ '(3 'font-lock-string-face)))
;; auto-mode alist
(list "\\.ratpoisonrc\\'")
;; additional setup functions
@@ -174,8 +174,8 @@
(defun ratpoison-command-on-region (start end)
(interactive "r")
(mapcar 'ratpoison-command
- (split-string (buffer-substring start end)
- "\n")))
+ (split-string (buffer-substring start end)
+ "\n")))
(defun ratpoison-line ()
"Send the current line to ratpoison."
diff --git a/contrib/rpshowall.sh b/contrib/rpshowall.sh
index 487ad90..cb02795 100644
--- a/contrib/rpshowall.sh
+++ b/contrib/rpshowall.sh
@@ -1,17 +1,17 @@
#!/bin/sh
# rpshowall
-# ratpoison script to show all open windows
+# ratpoison script to show all open windows
# Copyright (C) 2003 Florian Cramer <cantsin@zedat.fu-berlin.de>
-# Usage :
+# Usage :
#
# rpshowall [no arguments]
# if called from a terminal, show all open windows and
# restore previous frame layout upon keystroke
#
# rpshowall [n>1]
-# show all open windows for n seconds,
+# show all open windows for n seconds,
# then restore previous frame layout
#
# rpshowall 0
@@ -24,9 +24,9 @@ fi
# Parse input argument
if [ $*>0 ]; then
- wait="$*"
-else
- wait=-1
+ wait="$*"
+else
+ wait=-1
fi
@@ -40,34 +40,34 @@ curlayout=`$RATPOISON -c fdump`
# Create split view of all open windows
$RATPOISON -c only
-i=2;
-while [ $i -le $framecount ]; do
- if [ $i -le `echo $framecount/2 | bc` ] ; then
- $RATPOISON -c hsplit
- else
- $RATPOISON -c vsplit
- fi
- $RATPOISON -c focus
- $RATPOISON -c focus
- i=$[$i+1];
+i=2;
+while [ $i -le $framecount ]; do
+ if [ $i -le `echo $framecount/2 | bc` ] ; then
+ $RATPOISON -c hsplit
+ else
+ $RATPOISON -c vsplit
+ fi
+ $RATPOISON -c focus
+ $RATPOISON -c focus
+ i=$[$i+1];
done
# Depending on the argument the script was executed with,
# 1- select a new window and exit opening it fullscreen
-# 2- restore frameset after keyboard input
-# 3- restore frameset after $wait seconds of delay
+# 2- restore frameset after keyboard input
+# 3- restore frameset after $wait seconds of delay
$RATPOISON -c "select $curframe"
if [ $wait -eq 0 ]; then
- $RATPOISON -i -c fselect
- $RATPOISON -c only
+ $RATPOISON -i -c fselect
+ $RATPOISON -c only
else
- $RATPOISON -i -c windows
- if [ $wait -eq -1 ]; then
- echo -n "Hit return to restore window layout. "
- read i
- else
- sleep $wait
- fi
- $RATPOISON -c "frestore $curlayout"
+ $RATPOISON -i -c windows
+ if [ $wait -eq -1 ]; then
+ echo -n "Hit return to restore window layout. "
+ read i
+ else
+ sleep $wait
+ fi
+ $RATPOISON -c "frestore $curlayout"
fi
diff --git a/contrib/rpws b/contrib/rpws
index 580495f..181b964 100755
--- a/contrib/rpws
+++ b/contrib/rpws
@@ -6,11 +6,11 @@
# Author Mike O'Connor <stew@vireo.org>
#
# Modified by Shawn Betts.
-#
+#
# code was adapeted from rpws that comes from ratpoison containing the follwing copyright:
# Copyright (C) 2003 Shawn Betts
# Author: Shawn Betts
-#
+#
use strict;
use Fcntl qw (:flock);
@@ -36,9 +36,9 @@ sub rp_call
sub ws_init_ws
{
-
+
my $num = shift;
-
+
rp_call( "gnew wspl$num" );
my $fd = fdump();
rp_call( "setenv fspl$num $fd" )
@@ -62,9 +62,9 @@ sub ws_init
my $i;
for( my $i = 0; $i < $num; $i++ )
{
- ws_init_ws( $i );
+ ws_init_ws( $i );
}
-
+
# Workspace 1 uses the 'default' group.
# Start in workspace 1.
$fd = fdump();
@@ -77,7 +77,7 @@ sub ws_init
if( -e "$lockfile" )
{
- unlink ("$lockfile" );
+ unlink ("$lockfile" );
}
}
@@ -91,18 +91,18 @@ sub ws_save
sub ws_restore
{
my $which = shift;
-
+
ws_save();
-
+
if( $which == 1 )
{
- rp_call( "gselect default" );
+ rp_call( "gselect default" );
}
else
{
- rp_call( "gselect wspl$which");
+ rp_call( "gselect wspl$which");
}
-
+
rp_call( "echo Workspace $which" );
my $last = rp_call( "getenv fspl$which" );
rp_call( "frestore $last" );
@@ -113,7 +113,7 @@ sub add_aliases
{
my $n = shift;
foreach my $i (1..$n) {
- rp_call ( "alias rpws$i exec $0 $i" );
+ rp_call ( "alias rpws$i exec $0 $i" );
}
}
@@ -121,7 +121,7 @@ sub add_keys
{
my $n = shift;
foreach my $i (1..$n) {
- rp_call ( "definekey top M-F$i rpws$i" );
+ rp_call ( "definekey top M-F$i rpws$i" );
}
}
@@ -164,9 +164,9 @@ rpws - Implements multiple workspaces in ratpoison
ratpoison in the contrib directory.
=head1 USAGE
-
+
Add the following line in ~/.ratpoisonrc
-
+
exec /path/to/rpws init 6 -k
This creates 6 aliases rpws1, rpws2, etc. It also binds the keys M-F1,
@@ -186,7 +186,7 @@ environment variable RPWS_LOCKFILE to your desired lockfile.
Copyright (c) 2005 Mike O'Connor
All rights reserved.
-
+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
@@ -196,4 +196,3 @@ environment variable RPWS_LOCKFILE to your desired lockfile.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
diff --git a/contrib/unrat.c b/contrib/unrat.c
index adce9b9..272ed6e 100644
--- a/contrib/unrat.c
+++ b/contrib/unrat.c
@@ -1,4 +1,4 @@
-/* Warp the pointer to the bottom right corner of the screen any time a key is pressed.
+/* Warp the pointer to the bottom right corner of the screen any time a key is pressed.
*
* Copyright (C) 2005 Shawn Betts <sabetts@vcn.bc.ca>
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* unrat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
@@ -61,38 +61,38 @@ main (int argc, char **argv)
{
unsigned int j, nwins;
Window dw1, dw2, *wins;
-
+
XSelectInput(display,RootWindow(display, i), KeyReleaseMask | SubstructureNotifyMask);
XQueryTree(display, RootWindow(display, i), &dw1, &dw2, &wins, &nwins);
for (j=0; j<nwins; j++)
- XSelectInput(display, wins[j], KeyReleaseMask);
+ XSelectInput(display, wins[j], KeyReleaseMask);
}
- while (1)
+ while (1)
{
XEvent event;
- do
- {
- XNextEvent(display,&event);
- if (event.type == CreateNotify)
- XSelectInput(display, event.xcreatewindow.window, KeyReleaseMask);
- } while(event.type != KeyRelease);
+ do
+ {
+ XNextEvent(display,&event);
+ if (event.type == CreateNotify)
+ XSelectInput(display, event.xcreatewindow.window, KeyReleaseMask);
+ } while(event.type != KeyRelease);
/* A key was pressed. warp the rat. */
- for (i=0; i<numscreens; i++)
- {
- int x, y, wx, wy;
- unsigned int mask;
- Window root, child;
+ for (i=0; i<numscreens; i++)
+ {
+ int x, y, wx, wy;
+ unsigned int mask;
+ Window root, child;
- XQueryPointer (display, RootWindow(display, i),
- &root, &child,
- &x, &y, &wx, &wy,
- &mask);
- if (x < DisplayWidth (display, i)-1
- || y < DisplayHeight (display, i)-1)
- XWarpPointer (display, None, RootWindow(display, i), 0, 0, 0, 0, DisplayWidth (display, i), DisplayHeight (display, i));
- }
+ XQueryPointer (display, RootWindow(display, i),
+ &root, &child,
+ &x, &y, &wx, &wy,
+ &mask);
+ if (x < DisplayWidth (display, i)-1
+ || y < DisplayHeight (display, i)-1)
+ XWarpPointer (display, None, RootWindow(display, i), 0, 0, 0, 0, DisplayWidth (display, i), DisplayHeight (display, i));
+ }
}
XCloseDisplay (display);