SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-03-24 03:00:57

illumin8
#! Junkie
From: Seattle
Registered: 2009-05-30
Posts: 407
Website

Using Screen to extend the terminal

Ive been playing with 'screen' a bit lately.
If you arent familiar with it, heres a decent article on it.

Screen enables you to spawn a nearly unlimited number of "screens" in a terminal.
it also has a ~/.screenrc configuration file which has options for key bindings, number of screens to launch when you start the app,
and what apps to start in each screen.

I dont have a graphical login manager installed, so i have screen set up tp provide a complete minimal working environment when im not running an X session.
By invoking 'screen' in a terminal,
Elinks, Alpine mail, irssi, finch IM client, newsbeuter, rtorrent,midnight commander, nVLC,or my MPD controller start with their respective screen sessions indicated on the bottom of the terminal..

55814157.th.png


Heres my ~/.screenrc:

## ~/.screenrc
#
startup_message off
vbell off
bell_msg '^G'
activity "active: %n (%t) [%w:%s]"
msgwait 5 # 1 second messages
defscrollback 30000
 
#caption splitonly "%{= B} %{= G}%{R}%%t"
# always caption current window
caption always '%{= M} %= %{= w}%-w%{+b r}%n*%t%{-b r}%{w}%+w %= %{= M}'
 
autodetach on
deflogin on
defflow off
nethack on
defutf8 on
altscreen on
defbce on
nonblock on
defhstatus "screen: ^En (^Et)"
terminfo urxvt-256color* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
 
#hardstatus alwayslastline '%{= M} %H%{= G} %l %= %{= w}%-w%{+b r}%n*%t%{-b r}%{w}%+w %= %{c}%d %D %{B}%c '
#hardstatus alwayslastline "%{= wd}%?%-Lw%?%{=br WB}%n*%f %t%{=r dw}%?(%u)%?%{= wd}%?%+Lw%?%{=r dw}"
# programs
screen -t WEB 0 elinks
screen -t MAIL 1 alpine
screen -t IRC 2 irssi
screen -t CHAT 3 finch
screen -t NEWS 4 newsbeuter
screen -t TOR 5 rtorrent
screen -t FILES 6 mc
screen -t HTOP 7 htop
screen -t VLC 8 nvlc
screen -t BASH 9 bash
 
# keybindinigs
bindkey "^[@" prev 
bindkey "^@@" next 

The default key bindings are kind of odd at first.
Cntl-a primes screen for input.
then 0-9 will take you to that respective screen.
n=next,
p=previous
k= kill
c= creates a new screen

man screen for LOTS more info...

Last edited by illumin8 (2010-03-24 03:56:26)


Website    500px     DeviantArt
God never ends anything on a negative; God always ends on a positive. -- Edwin Louis Cole --

Offline

Be excellent to each other!

#2 2010-03-24 03:22:40

johnraff
#!Drunkard
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,843
Website

Re: Using Screen to extend the terminal

Thanks! Screen might be what I want for an old Toshiba laptop with 16MB of RAM...
roll


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#3 2010-03-24 03:53:26

illumin8
#! Junkie
From: Seattle
Registered: 2009-05-30
Posts: 407
Website

Re: Using Screen to extend the terminal

johnraff wrote:

Thanks! Screen might be what I want for an old Toshiba laptop with 16MB of RAM...
roll

Yes!! Ive been working on that very thing.
Running an effective X-less system.

there is also gdm which is a small mouse-action server for the terminal, (sort of weird to configure, and is more for using the mouse for copy/paste between screens) and Twin which looks like a WM on ncurses and spawns "floating" terminal sessions.  Also if you havent, check out Finch. It is the CLI version of Pidgin and uses the purple libs. You can enable all of the features of Pidgin including facebook chat, twitter and identica.

The two things im looking for now are a decent no-x pdf viewer or converter, and getting mplayer, xine, or vlc to play on my system in frame buffer mode.

Last edited by illumin8 (2010-03-24 03:54:36)


Website    500px     DeviantArt
God never ends anything on a negative; God always ends on a positive. -- Edwin Louis Cole --

Offline

#4 2010-03-24 04:45:54

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,416

Re: Using Screen to extend the terminal

FYI the mouse action server is called gpm not gdm wink

Offline

#5 2010-03-24 05:32:34

johnraff
#!Drunkard
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,843
Website

Re: Using Screen to extend the terminal

illumin8 wrote:
johnraff wrote:

Thanks! Screen might be what I want for an old Toshiba laptop with 16MB of RAM...
roll

Yes!! Ive been working on that very thing.
Running an effective X-less system.

Should I start a new thread on X-less for ancient boxes, or discuss my (small) progress so far here?

edit: On reflection, this is the Tips, Tricks & Scripts section, so maybe a new thread in the Off Topic section would be better...

Last edited by johnraff (2010-03-24 05:36:42)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#6 2010-03-24 11:21:40

illumin8
#! Junkie
From: Seattle
Registered: 2009-05-30
Posts: 407
Website

Re: Using Screen to extend the terminal

johnraff wrote:
illumin8 wrote:
johnraff wrote:

Thanks! Screen might be what I want for an old Toshiba laptop with 16MB of RAM...
roll

Yes!! Ive been working on that very thing.
Running an effective X-less system.

Should I start a new thread on X-less for ancient boxes, or discuss my (small) progress so far here?

edit: On reflection, this is the Tips, Tricks & Scripts section, so maybe a new thread in the Off Topic section would be better...

Id love to see what you come up with.


Website    500px     DeviantArt
God never ends anything on a negative; God always ends on a positive. -- Edwin Louis Cole --

Offline

#7 2010-03-24 12:23:23

benj1
Wiki Wizard
From: Yorkshire, England
Registered: 2009-09-05
Posts: 1,084

Re: Using Screen to extend the terminal

I never really got into screen, I should really give it another go because quite a few people wax lyrical about it, (although some peole go on about vim too wink)

readers might be interrested in this blog http://kmandla.wordpress.com/ which has quite a few posts on interresting terminal apps.


- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Offline

#8 2010-03-24 15:52:01

johnraff
#!Drunkard
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,843
Website

Re: Using Screen to extend the terminal

illumin8 wrote:

Id love to see what you come up with.

Hey, don't hold your breath! At the moment just trying to get some kind of stable system installed so I can at least use it as a jukebox, for example. Debian Woody at the moment, but even that is kind of slow. Anyway I'll put up the story so far and invite all others  to chip in with their own ideas/experiences...

benj1 wrote:

readers might be interrested in this blog http://kmandla.wordpress.com/ which has quite a few posts on interresting terminal apps.

Yes this is definitely K.Mandla territory! big_smile But that's his blog, this is a forum, so maybe it's easier to toss ideas around here.

Last edited by johnraff (2010-03-24 15:54:52)


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#9 2010-03-24 15:59:24

johnraff
#!Drunkard
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,843
Website

Re: Using Screen to extend the terminal

benj1 wrote:

some peole go on about vim too wink

Some day I'll no doubt discover the true Meaning Of Vim.
Some day...
Meanwhile leafpad works OK, or gedit, or geany...


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#10 2010-03-25 12:25:12

tawan
#! Junkie
Registered: 2009-01-30
Posts: 385
Website

Re: Using Screen to extend the terminal

I have not taken the time to read the links yet but is this a possibility of screen..?

I turn on the PC and walk away. It will reach the login screen (slim) and I wont login (as I'm out or asleep) but screen will be able to launch rtorrent and download stuff for me while the computer sits at the login screen and I catch some zzz'ds.

?


I blog too much....       geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao

Offline

#11 2010-03-25 13:05:50

benj1
Wiki Wizard
From: Yorkshire, England
Registered: 2009-09-05
Posts: 1,084

Re: Using Screen to extend the terminal

tawan wrote:

I have not taken the time to read the links yet but is this a possibility of screen..?

I turn on the PC and walk away. It will reach the login screen (slim) and I wont login (as I'm out or asleep) but screen will be able to launch rtorrent and download stuff for me while the computer sits at the login screen and I catch some zzz'ds.

?

I wouldn't have thought so no, but i'm fairly sure you could launch a torrent daemon to run without the need to log in.


- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Offline

#12 2010-03-25 19:29:27

illumin8
#! Junkie
From: Seattle
Registered: 2009-05-30
Posts: 407
Website

Re: Using Screen to extend the terminal

tawan wrote:

I have not taken the time to read the links yet but is this a possibility of screen..?

I turn on the PC and walk away. It will reach the login screen (slim) and I wont login (as I'm out or asleep) but screen will be able to launch rtorrent and download stuff for me while the computer sits at the login screen and I catch some zzz'ds.

?

If im not mistaken you are running Arch yeah?

ArchWiki has a howto to do that very thing.
http://wiki.archlinux.org/index.php/RTorrent
You need to add rtorrent as a user, and place the bash script in /etc/rc.d/

Actually you could use this method to daemonise a number of cli apps...

Last edited by illumin8 (2010-03-25 19:30:02)


Website    500px     DeviantArt
God never ends anything on a negative; God always ends on a positive. -- Edwin Louis Cole --

Offline

#13 2010-03-25 20:08:35

tawan
#! Junkie
Registered: 2009-01-30
Posts: 385
Website

Re: Using Screen to extend the terminal

benj1 wrote:

I wouldn't have thought so no, but i'm fairly sure you could launch a torrent daemon to run without the need to log in.

illumin8 wrote:

ArchWiki has a howto to do that very thing.
http://wiki.archlinux.org/index.php/RTorrent

HA perfect, thanks guys.


I blog too much....       geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao

Offline

#14 2010-05-18 21:56:23

jvd
#! CrunchBanger
Registered: 2010-01-29
Posts: 193

Re: Using Screen to extend the terminal

Thanks for this Arch-link: I finally have rtorrent loading in screen from startup!

Just out of curiosity: How come that entering

screen -t rtorrent rtorrent

in a terminal gets the whole thing going, and putting it in autostart.sh doesn't?

Offline

#15 2010-05-18 23:08:24

jnb
#! Member
Registered: 2009-01-12
Posts: 71

Re: Using Screen to extend the terminal

if you are in x you have to specify a terminal. eg: xfce4-terminal -e screen etc...

Offline

#16 2010-05-18 23:27:41

jvd
#! CrunchBanger
Registered: 2010-01-29
Posts: 193

Re: Using Screen to extend the terminal

Aha... Thanks, jnb... But I still don't understand.

Isn't autostart.sh also interpreted by some kind of invisible terminal? And is there a way to see / know beforehand if an application or a demand would work without invoking it in a 'real' terminal?

And as for screen: Isn't the whole fun of it is that it virtualizes terminal processes (haha, can one call it like that? tongue ), so that they don't actually depend on being displayed somewhere. So why does screen need to be run in a specified 'terminal' environment?

Offline

#17 2010-05-18 23:52:16

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,416

Re: Using Screen to extend the terminal

jvd wrote:

Isn't autostart.sh also interpreted by some kind of invisible terminal?

Well since its invisible then you wouldn't be able to see the app you run. Its working as intended.

jvd wrote:

And is there a way to see / know beforehand if an application or a demand would work without invoking it in a 'real' terminal?

You would generally know if an application has a GUI or if it uses cli. htop is a cli application so to launch it you have to use "terminal -e htop".

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo