Topic: .screenrc files

I'm using screen more and I've seen some folks with amazing setups, but I can't seem to find a really solid .screenrc reference out there.  Seeing the .bashrc thread made me wonder if people have similar suggestions for gnu screen.

This is what I'm using now:

# .screenrc
# Basic
vbell           on
defscrollback   10000
autodetach      on

# status
hardstatus alwayslastline "%{= kw}%{g}[ %{R}%H %{g}] %{Y} %{g}[%=%{ =kw}%{w}%-w%{Y}[%{W}%n-%t%{Y}]%{w}%+w%=%{g}][ %{w}%m-%d %{Y}%c %{g}]"

# add caption
caption splitonly "%{= kw}%?%-Lw%?%{kw}%n*%t%f %?(%u)%?%{= kw}%?%+Lw%?"

http://omploader.org/tMWxuMA

I find the keyboard bindings to be an awkward emacs-y experience.  Anyone have a good setup?

FHSM: avoid vowels and exotic consonants and you'll get your handle every time.  identi.ca

Re: .screenrc files

I second this -- I've seen it used to great effect, but I've really got no idea how to really make use of it... I feel like I did when I first launched Vi... hmm

Re: .screenrc files

evhan wrote:

I second this -- I've seen it used to great effect, but I've really got no idea how to really make use of it... I feel like I did when I first launched Vi... hmm

The vim learning curve with the finger twisting bindings of emacs... if it wasn't so awesome it'd be dead.  If you are having a hard time figuring out how to make the darn thing work at all I've found this to be a good simple intro and this is a helpful reference   I've never found a really great cheat sheet but this is the best I've turned up.

FHSM: avoid vowels and exotic consonants and you'll get your handle every time.  identi.ca

Re: .screenrc files

Hey, that's really helpful -- thanks.

I'm having to SSH into a university computer right now, and without my beloved .bashrc (or bash at all -- I can't find it on their systems and the default is tcsh), I need something to help me out (of course, I'm spending more time playing with sc reen than working....).

Re: .screenrc files

^ Glad it helped, guess sometimes the blind can lead the blind.  Now we just need someone who really knows what's up...

FHSM: avoid vowels and exotic consonants and you'll get your handle every time.  identi.ca

Re: .screenrc files

I'm a little surprised #! doesn't have more screen zealots.  I thought I'd give this a bump and see if anyone is out there now.

If screen is new to you:
http://www.nixtutor.com/linux/introduct … nu-screen/
http://news.softpedia.com/news/GNU-Scre … 4274.shtml

FHSM: avoid vowels and exotic consonants and you'll get your handle every time.  identi.ca

Re: .screenrc files

The first time I ran screen, it showed me a list of profiles I could use. I chose ubuntu-dark. This profile sported a bar at the bottom of the terminal showing different info about your computer. Also, pressing f9 will bring up an ncurses menu of options. This menu of options includes an option to change your profile. I changed my profile into plain and now the bar was gone, and pressing f9 does nothing. Any ideas how to bring this back?

Re: .screenrc files

I use screen a lot and one of the first changes I made was setting "#" as the escape key. This is very handy with the german keyboard layout.
(So instead of typing 'Ctrl+a ...' I have to type '# ...') I also made a lot of changes on the keybindings to fit them to my needs.

Maybe somebody finds this useful.

## ~/.screenrc

# ==============================================================================
# SCREEN SETTINGS
# ==============================================================================

setenv LANG de_DE.UTF-8

shell bash

# Get battery status
backtick 1 0 0 $HOME/bin/batt_stat

# Get local temperature
backtick 2 0 0 $HOME/bin/celsius

startup_message off

# Escape key is "#"
escape \##

# Screen messages: black on bright green
sorendition "kG"

#defflow on # will force screen to process ^S/^Q
deflogin on
autodetach on

# visual bell
vbell off

# define a bigger scrollback, default is 100 lines
defscrollback 1000

# If a window goes unresponsive, don't block the whole session waiting for it.
defnonblock on

# Screensaver
#idle 600 eval "screen cmatrix -f" "idle 0"

# Lock screen
#idle 1800 lockscreen

# ==============================================================================
# SCREEN KEYBINDINGS
# ==============================================================================

# Remove some key bindings
bind ^B
bind ^C
bind d
bind ^D
bind ^F
bind ^H
bind i
bind k
bind l
bind ^L
bind n
bind N
bind ^N
bind p
bind ^P
bind ^R
bind s
bind ^S
bind t
bind ^T
bind x
bind ^X
bind z
bind ^Z
bind ^[
bind ^]
bind ^?
bind ^@
bind \
bind {
bind }

# New key bindings
bind a screen
bind c screen -t cmatrix cmatrix
bind D detach
bind E screen nano $HOME/.screenrc
bind H history
bind i screen -t identi.ca 5 bashic
bind K kill
bind L lockscreen
bind m screen -t mail 3 mutt
bind n number
bind N screen -t nabble elinks www.nabble.com/Gnu---Screen-f1787.html
bind Q quit
bind r screen -t rss 6 newsbeuter -r
bind R redisplay
bind t screen -t twitter 4 bashtc
bind T screen -t tutorial elinks www.delorie.com/gnu/docs/screen/screen_toc.html
bind V split -v
bind w screen -t web 2 elinks www.google.de
bind z screen -t zsh
bind ^Z suspend
bind = resize =
bind + resize +1
bind * resize +9
bind - resize -1
bind _ resize -9
bind / resize max

# Function keys to switch terminals
# -k F1 = F11, -k F2 = F12
bindkey -k F1 prev
bindkey -k F2 next

# Arrow keys to switch terminals (only works with X)
# Ctrl + Alt + left
bindkey ^[[1;7D prev
# Ctrl + Alt + right
bindkey ^[[1;7C next

# An example of a "screen scraper" which will launch urlview on the current screen window
bind U eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# ==============================================================================
# TERMINAL SETTINGS
# ==============================================================================

# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007

# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

# Scrolling in xterm
termcapinfo xterm|xterms|xs|rxvt ti@:te@

# sending of screen messages to hardstatus
hardstatus on

# hard status string
hardstatus alwayslastline
hardstatus string "%{= kG}[ %{Y}%H %{g}][%= %{= kw}%?%-Lw%?%{g}%n-%t%?(%u)%?%{w}%?%+Lw%?%?%= %{g}][ %{y}%1`%%%{g} ][ %{y}%2`%{g} ][%{y} %D %d.%m. %c %{g}]"

# ==============================================================================
# STARTUP SCREENS
# ==============================================================================

screen -t htop 0 htop
screen -t bash 1 bash
#screen -t bash 2 bash
#screen -t twitter 4 bashtc
#screen -t identi.ca 5 bashic
screen -t rss 6 newsbeuter -r
screen -t audio 7 cplay
screen -t vol 8 alsamixer
screen -t mc 9 mc /data/audio/podcasts /
select 1
Acer Extensa 5220 || Debian "Squeeze" & Fluxbox | #! 10 "Statler" Alpha & Openbox
identi.ca/herrgruen

Re: .screenrc files

Hello all,

I use screen on my EeePC, mostly for connecting to my principal PC by Wifi and SSH (so I could launch "CPU/RAM eating applications" on my EeePC by this way, thanks to "X11 forwarding", cool cool). Really amazing apps, and totally Geek ! lol lol tongue

I'd like the key bindings : prec = f5 / next = f6 / new terminal = f7 / detach screen = f8 / kill terminal = f9 / quit screen = f10
Simple and very quick to use smile

# $Id: screenrc,v 1.15 2003/10/08 11:39:03 zal Exp $
#
# /etc/screenrc
#
#   This is the system wide screenrc.
#
#   You can use this file to change the default behavior of screen system wide
#   or copy it to ~/.screenrc and use it as a starting point for your own
#   settings.
#
#   Commands in this file are used to set options, bind screen functions to
#   keys, redefine terminal capabilities, and to automatically establish one or
#   more windows at the beginning of your screen session.
#
#   This is not a comprehensive list of options, look at the screen manual for
#   details on everything that you can put in this file.
#

# ------------------------------------------------------------------------------
# SCREEN SETTINGS
# ------------------------------------------------------------------------------

startup_message off
#nethack on

#defflow on # will force screen to process ^S/^Q
deflogin on
autodetach on

# turn visual bell on
vbell on
vbell_msg "   Wuff  ----  Wuff!!  "

# define a bigger scrollback, default is 100 lines
defscrollback 1024

altscreen on

# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

#raccourcis
bindkey -k k5 prev  # precedent = f5
bindkey -k k6 next  # suivant = f6
bindkey -k k7 screen # créer un terminal = f7
bindkey -k k8 detach # détacher le screen = f8
bindkey -k k9 kill  # tuer le terminal = f9
bindkey -k k; quit  # quitte screen = f10

# Remove some stupid / dangerous key bindings
bind ^k
#bind L
bind ^\
# Make them better
bind \\ quit
bind K kill
bind I login on
bind O login off
bind } history

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------

# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# turn sending of screen messages to hardstatus off
hardstatus on
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|terminator*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# use this for the hard status string
#change the hardstatus settings to give an window list at the bottom of the
#screen, with the time and date and with the current window highlighted
hardstatus alwayslastline 
#hardstatus string '%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%s%{-}'
#hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'
#hardstatus string "%{bk}%?%-Lw%?%{wb}%n*%f %t%?(%u)%?%{bk}%?%+Lw%= %{mk}@ %H %{ck}%Y%{bk}-%{ck}%m%{bk}-%{ck}%d %{yk}%D %{gk}%c"
#hardstatus string "%{=b .r}%D %d/%m %{w}- %{r}%c%{w} || [%{g}@%H%{w}] %w %= %1` | %{b}%l%{w}"
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'

# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
#  in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

# To get screen to add lines to xterm's scrollback buffer, uncomment the
# following termcapinfo line which tells xterm to use the normal screen buffer
# (which has scrollback), not the alternate screen buffer.
#
#termcapinfo xterm|xterms|xs|rxvt ti@:te@

# Enable non-blocking mode to better cope with flaky ssh connections.
defnonblock 5

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

# Example of automatically running some programs in windows on screen startup.
#
#   The following will open top in the first window, an ssh session to monkey
#   in the next window, and then open mutt and tail in windows 8 and 9
#   respectively.
#
screen -t BASH_EeePC 1 bash
screen -t HTOP 2 htop
screen -t IFTOP 3 sudo iftop -i wlan0
screen -t MUSIC 4 mp3blaster
screen -t SSH-1_Portable 5 ssh -XC serveur
screen -t SSH-2_Portable 6 ssh -XC serveur
screen -t SSH-3_Portable 7 ssh -XC serveur
select 1

Re: .screenrc files

I use screen, and have opened fshm's links to find out more. big_smile
It's one of those things I was told about ages ago, and just never worked the hell out. So it gets used as a glorified session keeper for irssi rather than for it's true potential.
screen irssi
screen -r
Are about the only 2 commands I use, and the only other command I know is
Ctrl+a d
So hopefully going to learn some more from the links.

rats live on no evil star

11

Re: .screenrc files

startup_message off
term screen-256color

hardstatus alwayslastline "%{= dd}%-w%{+b}%n %t%{-}%+w %=%{= dW}%h%{-}%20`%10`"

pretty simple