Results 1 to 8 of 8

Thread: How to split GNU/Screen at start?

  1. #1
    Join Date
    Jun 2006
    Location
    St. Petersburg, Russia
    Beans
    15
    Distro
    Ubuntu 10.04 Lucid Lynx

    How to split GNU/Screen at start?

    Hello,

    Can't figure it out myself or with Google's help, perhaps someone here might help me.

    I would like to start the Screen program with several new windows and with a certain layout. So that basically i want predefined layout at start, let's say screen splitted once horizontally and then once vertically (i have applied the patch for vertical splitting). And in each part of the splitted screen a new terminal instance running.

    Is there a way to achieve that?
    Thanks for help!

  2. #2
    Join Date
    Jun 2007
    Beans
    538

    Re: How to split GNU/Screen at start?

    The screen program uses the full screen, and allows switching between screens.
    You are using a patched program, so you should know what that patch does.
    Dividing the screen into subsections would be a software problem.
    Look into a curses program, such as ncurses. It should do what you are suggesting.

    Gerald

  3. #3
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to split GNU/Screen at start?

    Using an unpatched screen, the following screenrc creates a horizontal split with window 0 at top and window 1 at bottom.
    Code:
    split
    screen
    focus
    screen
    Does that help?

  4. #4
    Join Date
    Oct 2008
    Location
    England
    Beans
    960
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to split GNU/Screen at start?


  5. #5
    Join Date
    Jun 2006
    Location
    St. Petersburg, Russia
    Beans
    15
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to split GNU/Screen at start?

    Quote Originally Posted by geirha View Post
    Using an unpatched screen, the following screenrc creates a horizontal split with window 0 at top and window 1 at bottom.
    Code:
    split
    screen
    focus
    screen
    Does that help?
    Yes, it does exactly what i wanted! Thanks a lot, will try to adjust the .screenrc file.
    Wohoo!

    PS. Terminator is a nice app, however i need something what would work with or without X's. Screen is really great for that.
    PPS. In case someone is interesting, here is my simple .screenrc file:

    Code:
    startup_message       off
    vert_split
    screen
    focus
    screen -t mc 0 mc
    Here is great collection of examples:
    http://www.softpanorama.org/Utilitie...examples.shtml
    Last edited by longman; February 26th, 2009 at 02:43 PM.

  6. #6
    Join Date
    Nov 2006
    Beans
    21
    Distro
    Ubuntu 10.10 Maverick Meerkat

    How to split GNU/Screen at start with vertical splits.

    I split mine into 4ths. Here's how:

    # Uninstall screen if you have it installed already
    Code:
    sudo aptitude purge screen
    # Install dependencies to build screen
    Code:
    sudo apt-get build-dep screen
    # Create an area to hold the source
    Code:
    cd ~/
    mkdir screen
    cd screen
    # Get the latest source
    Code:
    wget http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz
    # Extract the source
    Code:
    tar xvf screen-4.0.3.tar.gz
    # Download extract and apply vertical split patch
    Code:
    cd screen-4.0.3/
    wget http://vsp4sdl.yuggoth.org/wrp_vertical_split_0.3_4.0.2.diff.bz2
    bunzip2 wrp_vertical_split_0.3_4.0.2.diff.bz2
    patch -p1 < wrp_vertical_split_0.3_4.0.2.diff
    # Build it!
    Code:
    ./configure && make
    # Install it!
    Code:
    sudo mv screen /usr/local/bin/
    #Use my .screenrc
    Code:
    nano ~/.screenrc

    ##########.screenrc##########
    activity "%c activity -> %n%f %t"
    autodetach on
    altscreen on
    bell "%c bell -> %n%f %t^G"
    defflow auto
    defscrollback 10000
    defutf8 on
    msgwait 2 # 1 second messages
    startup_message off # disable the startup splash message
    shell -bash
    vbell_msg "[[[ ding ]]]"
    vbell off
    nethack on
    zombie cr

    # remove some key bindings
    bind k
    bind W
    bind ^k
    bind .
    bind ^\
    bind \\
    bind ^h
    bind h
    # make them safer
    bind 'K' kill
    bind 'W' windowlist
    bind 'V' vert_split

    # F8 to turn the status bar off
    #bindkey -k k8 hardstatus alwayslastline
    # F9 to turn the status bar on
    #bindkey -k k9 hardstatus alwaysignore
    # F5 and F6 to move one screen forward or backward
    bindkey -k k5 prev
    bindkey -k k6 next


    split
    screen -t rtorrent rtorrent -o http_capath=/etc/ssl/certs
    vert_split
    focus up
    screen -t irssi irssi
    focus up
    screen -t bash bash
    focus down
    vert_split
    screen -t bash bash
    focus down
    select irssi

    # If you need more terms then uncomment however many you need.
    #screen -t bash bash
    #screen -t bash7 bash
    #screen -t bash8 bash
    #screen -t bash9 bash

    ########End of script########
    Attached Images Attached Images

  7. #7
    Join Date
    May 2011
    Beans
    1

    Re: How to split GNU/Screen at start?

    In the lastest version of screen, you don't need the patch above. Just use split -v instead of vert_split in the above response.

  8. #8
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 19.10 Eoan Ermine

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •