Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Arranging Terminal windows' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Arranging Terminal windows
Authored by: jaysoffian on Nov 05, '03 11:40:14PM
Hmm, gratuitous use of C if you ask me :-)
How about the following sh one-liner for xgeom?

#!/bin/sh
printf '^[[8;%d;%dt^[[3;%d;%dt' $@

You could also define this as shell function in the same place you're setting up your bash aliases.

---
j.


[ Reply to This | # ]

One-liner [Arranging Terminal windows]
Authored by: ubi on Nov 06, '03 12:29:23AM

Thanks for the tip. I never knew about printf as a sh/bash command. Cool. The only thing my C code does better is handle a variable number of arguments. Here's the suggested bash function:

function xgeom { printf '^[[8;%d;%dt^[[3;%d;%dt' $@ ; }



[ Reply to This | # ]
One-liner [Arranging Terminal windows]
Authored by: kmue on Nov 06, '03 04:22:13AM
Nice! Its easier to cut 'n pasta if you use escape codes:

xgeom() { printf '\033[\033[8;%d;%dt\033[\033[3;%d;%dt' $@; }


[ Reply to This | # ]