Small Update rpws

Vasil Zlatanov <[email protected]>
Newsgroups gmane.comp.window-managers.ratpoison.devel
Message-ID <[email protected]>
I've been asked a few times on IRC about a command to move the current
window to a selected workspace, which is undocemented for some reason.

Addionaly I added an option that prints the current workspace which
would be usefull for conky like configs.

_______________________________________________
Ratpoison-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ratpoison-devel
vaskozl-rpws_updates.patch (text/x-diff, 3.2 KB)
From 708fa69f48f10dcbefc20633f553db660be47b24 Mon Sep 17 00:00:00 2001
From: Vasil Zlatanov <[email protected]>
Date: Tue, 31 Dec 2013 00:08:15 +0100
Subject: [PATCH] Updated rpws to documents the "rpwsm$i" functionality, made
 it's bindings more sane and added an option "current" which prints the
 current workspace.

---
 contrib/rpws | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/contrib/rpws b/contrib/rpws
index 49105c5..558fd1c 100755
--- a/contrib/rpws
+++ b/contrib/rpws
@@ -1,5 +1,10 @@
 #!/usr/bin/env perl
 
+# Copyright (c) 2013 Vasil Zlatanov <[email protected]>
+# All rights reserved. Modifications under same license as original script.
+# Changelog:
+# 	Updated manpage and hotkeys
+# 	Added argument current which outputs the current workspace.
 #
 # Copyright (c) 2009 Hatem Nassrat <[email protected]>
 # All rights reserved. Modifications under same license as original script.
@@ -245,7 +250,7 @@ sub add_keys
         # Switch Workspace
         rp_call ( "definekey top M-F$i rpws$i" );
         # Move Window to wrokspace
-        rp_call ( "definekey top C-M-S-F$i rpwsm$i" );
+        rp_call ( "definekey top C-M-F$i rpwsm$i" );
     }
     rp_call ( "definekey top C-M-Right rpwsn" );
     rp_call ( "definekey top C-M-Left rpwsp" );
@@ -270,6 +275,9 @@ if( $arg eq "help" ) {
 } elsif( $arg eq "restore" ) {
     my $filename = shift @ARGV;
     ws_dumprestore($filename);
+} elsif ( $arg eq "current" ) {
+   my $cws = rp_call( "getenv wspl" );
+   print "$cws";
 } else {
    open LOCK, ">>$lockfile" or die "Cannot open lockfile: $lockfile";
    flock(LOCK, LOCK_EX);
@@ -287,10 +295,11 @@ rpws - Implements multiple workspaces in ratpoison
  rpws init n [-k] [-a]  - setup rpws with n workspaces.
                             -a sets up command aliases;
                             -k sets up key bindings and aliases.
+ rpws n                 - switch to this workspace
  rpws dump <fname>      - dumps the current layout to <fname>
  rpws restore <fname>   - restores rpws workspaces from <fname>
+ rpws current           - print the number of the current workspace
  rpws help              - this documentation
- rpws n                 - switch to this workspace
 
 
 =head1 DESCRIPTION
@@ -306,14 +315,15 @@ 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,
-M-F2, etc to each rpwsN alias. Moreover, rpwsn (Next) and rpwsp (Prev) are
+M-F2, etc to each rpwsN alias. Aliases rpwsm1, rpwsm2, etc, are used to
+move the focused window to another workspace. Moreover, rpwsn (Next) and rpwsp (Prev) are
 created, and C-M-{Right,Left} are bound to rpws{n,p}. Full list of keybindings
 created are:
 
     M-F$i           Goto workspace $i
     C-M-Right       Goto Next workspace
     C-M-Left        Goto Prev workspace
-    C-M-S-F$i       Move window to workspace $i
+    C-M-F$i         Move window to workspace $i
     C-M-greater     Move current window to next workspace
     C-M-less        Move current window to prev workspace
 
-- 
1.8.3.2
signature.asc (application/pgp-signature, 490 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iQEcBAEBAgAGBQJSwgFlAAoJEO5QSAKJUTTF15kH/jXFv4f2EfuerBuTmIZnDv5K
Fwse5ECcSNtxAol8x+irCY7ycEzfC9QXuCTKneQE04gooqkQ/iOzGo9FxQFGiHeD
N51Dsxg9pISFPuILMtVBc6idGplYF/P656C0TdMNQe8XCsCSoZCSJBHeVqkmkKqy
rcmmePz8uGJhGFCsgLAFvRIKE79M+Ap6NRMbo2jdlGoHm3QN2FjqJX1OmrjQgUY6
PjubVjQBQlCiYF9hqcce3y0nBR0moA3E/mSkQZAEcezddJaFUXcHsM7wDifMSsts
lMO9o9PuAkSC5I4gLLnFzhgJFCedv8nqeD1oHZSCGUvqp44PMLlBWZIhpRin5TM=
=Esdd
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.