Origami class: Fun with screen-vs

Time for some good, old-fashioned, knuckle-popping keyboard gymnastics. For a little while now I have been wanting to discuss how to wrangle screen with the vertical split patch, and fold it into unusual shapes, like this.

Granted, at 800×600, that’s a bit of an eyeful. And setting it up can be a rather tricky process. I tried to explain it a little bit here, when I talked about building screen-vs, but it can take a little getting used to, and isn’t always intuitive.

Before I go any further, I should say that your screen might act differently than mine, depending on the distro and how it was built. If you find that these instructions don’t quite match how your version of screen is behaving (I’m looking at you, Ubuntu users), then you should consider building it from scratch, from the source package. It’s an easy thing to do, and to be honest, screen’s vanilla behavior is a lot more likeable than some of the variations I’ve seen.

To start, open screen and give yourself a few windows to play with. What you run in them isn’t important, but try to pick applications that won’t crash when resized, or don’t need a particular dimension to be happy. :roll:

Now jump to an open window and press CTRL+a S. That’s a capital S.

Nice. A simple horizontal split. Do it once more, and you should have three strips running horizontally.

That’s the basis of creating a new layout: Split the window, and screen evenly divides the space that’s available. Now jump to the second, central strip by pressing CTRL+a TAB. Then press CTRL+a X. That’s a capital X.

CTRL+a X removes windows from the arrangement, and since the previous window is occupied, it spills into the removed space. However, screen didn’t reallocate the space to make an even split, so the bottom third of the screen is still a separate space.

And that’s basically how the magic happens. Since screen doesn’t automatically redraw everything evenly, you can shift and partition spaces in any depth or width you like, by repeatedly splitting it down to the size you like, and then subtracting out portions.

Let’s keep going. Now press CTRL+a V, and then again. That’s CTRL+a, followed by a capital V, then the same sequence again.

Now the top two-thirds of the screen is split into thirds vertically. Now we repeat the same thing we did a few seconds ago: Press CTRL+a TAB to jump to the next window, then press CTRL+a X to remove it.

Now we’ve got a nice neat postage stamp effect happening here, where the upper left two-thirds of the screen — both horizontally and vertically — are partitioned off in a space proportional to your native screen dimensions.

There’s no rule that says we can’t further split these windows, beyond what we’ve done already. Press CTRL+a TAB once more to enter that last vertical third, then press CTRL+a S again, to split that one horizontally again.

Be aware that you might see a few screen artifacts here and there; nothing is perfect, but they should disappear or be overwritten as you use the windows. If not, file a bug report against screen, or the patch, or both. ;)

What to do with those little teeny spaces? Well, clocks are fun to have in there, or mail notification tools, or even small disk space monitors or remote windows. (Run screen over ssh inside screen … it boggles the mind. … :shock: )

One more split and we’ll be done. Press CTRL+a TAB twice to jump to the bottommost horizontal third, and then split that vertically with CTRL+a V. It’s hard to see, but that will give you halves in that bottom third … sixths?

So what’s left? Pop windows into place as you like.

The only bad part of this system is if you make a mistake, you have to start from scratch (press CTRL+a Q to recover the entire screen and start over). In some cases it may behoove you to make sure you allocate certain parts first — for example, start up mplayer, then arrange the screen vertically to fit its depth, then partition the rest of the screen. Work smart, not hard.

But that’s all there is to it. Try a few different arrangements, and see what kind of results you get. If you find something particularly lovely or space-conscious, please feel free to share it.

Next up, how to make a balloon giraffe out of ed and a pair of 16Mb SIMM chips. :roll: ;)

About these ads

8 Responses to “Origami class: Fun with screen-vs”


  1. 1 Jose Catre-Vandis 2010/05/17 at 6:56 AM

    You warned them already but for ubuntu users (well ,my experience any way:

    With the default screen from the repos:

    Create a vertical split with CTRL + a then | (pipe)

    You won’t get thirds either vertically or horizontally, screen redraws to the centre

    Thanks KMandla for the updated howto on this. Such fun :)

  2. 2 Raichu 2010/05/17 at 8:23 AM

    Thank you very much for the tutorial, I have been very useful. BTW, I love your freaking awesome blog and all its howtos.

    Have a good day n_n

  3. 3 skingrapher 2010/05/18 at 3:57 AM

    Did you try tmux ? It’s a terminal multiplexer and I prefer it to screen, but I can’t use it on my LFS based distro system because it jumps to 100% CPU activity after 12 hours. :(

    You’ll find it at [url]http://tmux.sourceforge.net[/url]. I made a Pkgfile for it.

    Maybe you’ll be interested on testing it also. ;)

    • 4 K.Mandla 2010/05/18 at 5:53 AM

      I have, and I wanted to examine it more in the future. tmux is nice because you can adjust window sizes on the fly, instead of going through all the steps here. But it has a few downsides for me too. …

  4. 6 gruen 2010/05/18 at 5:29 PM

    Oh, I love GNU/Screen and I use it every day. It’s such a awesome program, especially when used with ssh!

    To set the size of my windows I use the ‘resize’ command.
    Excerpt from my .screenrc keybindings:

    bind = resize =
    bind + resize +1
    bind * resize +5
    bind – resize -1
    bind _ resize -5
    bind / resize max

    When I’m in a screen window I like to make larger 5 rows (or columns) I just type:

    # *

    (I use ‘#’ as the escape key, which is very handy with my german keyboard layout. So you have to type ‘ctrl a’ instead of that!)

    BTW: Nice blog, thanks for your work! :)


  1. 1 Links 17/5/2010: Firefox 3.6.4 Build 4, State Services Commission (NZ) Goes for Free Software | Techrights Trackback on 2010/05/18 at 12:47 AM
  2. 2 Screenshots from 120Mhz « Motho ke motho ka botho Trackback on 2010/09/06 at 10:03 AM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,963,101 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: