Re: Swap behavior request and thanks for the RPWS changes.
tomm smith <[email protected]>
| Newsgroups | gmane.comp.window-managers.ratpoison.devel |
|---|---|
| Message-ID | <[email protected]> |
I decided to whip together a simple POC wrapper for this swap issue, it is not beautiful but is very functional and should fill your desire until RP source is updated. I have attached the bash script to this email, please let me know any issues you may find, I have not found any thus far but havent really pushed it. To use it you could just unbind the normal key command for "swap" then bind the same key command to that script and your golden. On 3/9/10, tomm smith <[email protected]> wrote: > I had a quick thought on a shell wrapper script for swap to do exactly > what you stated above, but would be a nice feature. If I write the > wrapper I will share it. > > Thanks, glad it helps. I am writing the ability for rpws to move > windows to other workspaces currently, working but with exceptions. I > think gmove might have a bug, havent completely decided yet will > address that later. > > On 3/9/10, jbaber-p/sUDoRFkCz2fBVCVOL8/[email protected] <jbaber-p/sUDoRFkCz2fBVCVOL8/[email protected]> wrote: >> Hello, all, >> >> Tiny feature request: When there are only two frame visible, C-t x >> ought to just swap them no questions asked. What else could the user >> mean? >> >> Tomm Smith: the RPWS changes will be of use to at least me once it >> finally makes its way downstream into the standard repositories. Thank >> you. >> >> Sincerely yours, >> John B. >> -- >> He who makes a beast of himself gets rid of the pain of being a >> man. -Dr. Johnson >> >> >> _______________________________________________ >> Ratpoison-devel mailing list >> [email protected] >> http://lists.nongnu.org/mailman/listinfo/ratpoison-devel >> > _______________________________________________ Ratpoison-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/ratpoison-devel
swap_wrapper.sh
(application/x-sh, 675 B)
#!/bin/bash
# Synopsis: Simple wrapper script for ratpoisons "swap" feature
# Author: thims (root DOT packet AT gmail DOT com)
# Date: 20090309
# Comments:
# A simple wrapper script to give ratpoisons "swap" command the
# ability to automatically swap frames if only 2 frames are open.
frames=$(( $(ratpoison -c sfdump | sed 's/,/\n/g' | wc -l) - 1)) # minus 1 due to the trailing , in sfdump
framenum=( )
cnt=0
for i in $(ratpoison -c sfdump | sed 's/,/\n/g' | awk -F\n '{print $2}' | awk -F" " '{print $2}')
do
framenum[$cnt]=$i
cnt=$((cnt + 1))
done
if [ $frames == 2 ] ;then
ratpoison -c "swap ${framenum[0]} ${framenum[1]}"
else
ratpoison -i -c swap
fi